@@ -4,10 +4,11 @@ import expect from 'expect';
44import { OTLPAwsSpanExporter } from '../src/otlp-aws-span-exporter' ;
55import * as sinon from 'sinon' ;
66import * as proxyquire from 'proxyquire' ;
7- import nock = require ( 'nock' ) ;
7+ import * as nock from 'nock' ;
88import { getNodeVersion } from '../src/utils' ;
99
1010const XRAY_OTLP_ENDPOINT = 'https://xray.us-east-1.amazonaws.com' ;
11+ const XRAY_OTLP_ENDPOINT_PATH = '/v1/traces' ;
1112const AUTHORIZATION_HEADER = 'Authorization' ;
1213const X_AMZ_DATE_HEADER = 'X-Amz-Date' ;
1314const X_AMZ_SECURITY_TOKEN_HEADER = 'X-Amz-Security-Token' ;
@@ -18,7 +19,7 @@ const EXPECTED_AUTH_SECURITY_TOKEN = 'test_token';
1819
1920const nodeVersion = getNodeVersion ( ) ;
2021
21- /* istanbul ignore if */
22+ /* istanbul ignore else */
2223if ( nodeVersion < 16 ) {
2324 it . skip ( `Skipping tests - Node.js version ${ nodeVersion } is below required version 16` , ( ) => { } ) ;
2425} else {
@@ -31,7 +32,7 @@ if (nodeVersion < 16) {
3132 sandbox = sinon . createSandbox ( ) ;
3233
3334 scope = nock ( XRAY_OTLP_ENDPOINT )
34- . post ( '/v1/traces' )
35+ . post ( XRAY_OTLP_ENDPOINT_PATH )
3536 . reply ( ( uri : any , requestBody : any ) => {
3637 return [ 200 , '' ] ;
3738 } ) ;
@@ -67,7 +68,7 @@ if (nodeVersion < 16) {
6768 } ) ;
6869
6970 it ( 'Should inject SigV4 Headers successfully' , async ( ) => {
70- const exporter = new mockModule . OTLPAwsSpanExporter ( XRAY_OTLP_ENDPOINT + '/v1/traces' ) ;
71+ const exporter = new mockModule . OTLPAwsSpanExporter ( XRAY_OTLP_ENDPOINT + XRAY_OTLP_ENDPOINT_PATH ) ;
7172
7273 scope . on ( 'request' , ( req , interceptor , body ) => {
7374 const headers = req . headers ;
@@ -96,7 +97,7 @@ if (nodeVersion < 16) {
9697
9798 dependencies . forEach ( dependency => {
9899 it ( `should not sign headers if missing dependency: ${ dependency } ` , async ( ) => {
99- const exporter = new OTLPAwsSpanExporter ( XRAY_OTLP_ENDPOINT + '/v1/traces' ) ;
100+ const exporter = new OTLPAwsSpanExporter ( XRAY_OTLP_ENDPOINT + XRAY_OTLP_ENDPOINT_PATH ) ;
100101
101102 scope . on ( 'request' , ( req , interceptor , body ) => {
102103 const headers = req . headers ;
0 commit comments