|
1 | 1 | // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
2 | 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
3 | 4 | import { diag, SpanContext, SpanKind } from '@opentelemetry/api'; |
4 | 5 | import { ExportResultCode } from '@opentelemetry/core'; |
5 | 6 | import { Resource } from '@opentelemetry/resources'; |
@@ -67,8 +68,9 @@ describe('UdpExporterTest', () => { |
67 | 68 | }); |
68 | 69 |
|
69 | 70 | it('should throw when provided invalid endpoint', () => { |
| 71 | + // eslint-disable-next-line @typescript-eslint/ban-ts-comment |
70 | 72 | // @ts-ignore |
71 | | - expect(() => new UdpExporter(123)).toThrow(new Error("Invalid endpoint: 123")); |
| 73 | + expect(() => new UdpExporter(123)).toThrow(new Error('Invalid endpoint: 123')); |
72 | 74 | }); |
73 | 75 | }); |
74 | 76 |
|
@@ -176,15 +178,15 @@ describe('OTLPUdpSpanExporterTest', () => { |
176 | 178 | }); |
177 | 179 |
|
178 | 180 | it('should use expected Environment Variables to configure endpoint', () => { |
179 | | - process.env.AWS_LAMBDA_FUNCTION_NAME = "testFunctionName" |
180 | | - process.env.AWS_XRAY_DAEMON_ADDRESS = "someaddress:1234" |
| 181 | + process.env.AWS_LAMBDA_FUNCTION_NAME = 'testFunctionName'; |
| 182 | + process.env.AWS_XRAY_DAEMON_ADDRESS = 'someaddress:1234'; |
181 | 183 |
|
182 | | - let exporter = new OTLPUdpSpanExporter(undefined); |
183 | | - expect(exporter['_endpoint']).toBe('someaddress:1234') |
| 184 | + const exporter = new OTLPUdpSpanExporter(undefined); |
| 185 | + expect(exporter['_endpoint']).toBe('someaddress:1234'); |
184 | 186 | expect(exporter['_udpExporter']['_host']).toBe('someaddress'); |
185 | 187 | expect(exporter['_udpExporter']['_port']).toBe(1234); |
186 | 188 |
|
187 | | - delete process.env.AWS_XRAY_DAEMON_ADDRESS |
188 | | - delete process.env.AWS_LAMBDA_FUNCTION_NAME |
| 189 | + delete process.env.AWS_XRAY_DAEMON_ADDRESS; |
| 190 | + delete process.env.AWS_LAMBDA_FUNCTION_NAME; |
189 | 191 | }); |
190 | 192 | }); |
0 commit comments