@@ -86,39 +86,39 @@ if (nodeVersion >= 16) {
8686 await exporter . export ( [ ] , ( ) => { } ) ;
8787 } ) ;
8888
89- describe ( 'Should not inject SigV4 headers if dependencies are missing' , ( ) => {
90- const dependencies = [
91- '@aws-sdk/credential-provider-node' ,
92- '@aws-crypto/sha256-js' ,
93- '@smithy/signature-v4' ,
94- '@smithy/protocol-http' ,
95- ] ;
96-
97- dependencies . forEach ( dependency => {
98- it ( `should not sign headers if missing dependency: ${ dependency } ` , async ( ) => {
99- const exporter = new OTLPAwsSpanExporter ( XRAY_OTLP_ENDPOINT + XRAY_OTLP_ENDPOINT_PATH ) ;
100-
101- scope . on ( 'request' , ( req , interceptor , body ) => {
102- const headers = req . headers ;
103- expect ( headers ) . not . toHaveProperty ( AUTHORIZATION_HEADER ) ;
104- expect ( headers ) . not . toHaveProperty ( X_AMZ_DATE_HEADER ) ;
105- expect ( headers ) . not . toHaveProperty ( X_AMZ_SECURITY_TOKEN_HEADER ) ;
106-
107- expect ( headers [ 'content-type' ] ) . toBe ( 'application/x-protobuf' ) ;
108- expect ( headers [ 'user-agent' ] ) . toMatch ( / ^ O T e l - O T L P - E x p o r t e r - J a v a S c r i p t \/ \d + \. \d + \. \d + $ / ) ;
109- } ) ;
110-
111- Object . keys ( require . cache ) . forEach ( key => {
112- delete require . cache [ key ] ;
113- } ) ;
114- const requireStub = sandbox . stub ( require ( 'module' ) , '_load' ) ;
115- requireStub . withArgs ( dependency ) . throws ( new Error ( `Cannot find module '${ dependency } '` ) ) ;
116- requireStub . callThrough ( ) ;
117-
118- await exporter . export ( [ ] , ( ) => { } ) ;
119- } ) ;
120- } ) ;
121- } ) ;
89+ // describe('Should not inject SigV4 headers if dependencies are missing', () => {
90+ // const dependencies = [
91+ // '@aws-sdk/credential-provider-node',
92+ // '@aws-crypto/sha256-js',
93+ // '@smithy/signature-v4',
94+ // '@smithy/protocol-http',
95+ // ];
96+
97+ // dependencies.forEach(dependency => {
98+ // it(`should not sign headers if missing dependency: ${dependency}`, async () => {
99+ // const exporter = new OTLPAwsSpanExporter(XRAY_OTLP_ENDPOINT + XRAY_OTLP_ENDPOINT_PATH);
100+
101+ // scope.on('request', (req, interceptor, body) => {
102+ // const headers = req.headers;
103+ // expect(headers).not.toHaveProperty(AUTHORIZATION_HEADER);
104+ // expect(headers).not.toHaveProperty(X_AMZ_DATE_HEADER);
105+ // expect(headers).not.toHaveProperty(X_AMZ_SECURITY_TOKEN_HEADER);
106+
107+ // expect(headers['content-type']).toBe('application/x-protobuf');
108+ // expect(headers['user-agent']).toMatch(/^OTel-OTLP-Exporter-JavaScript\/\d+\.\d+\.\d+$/);
109+ // });
110+
111+ // Object.keys(require.cache).forEach(key => {
112+ // delete require.cache[key];
113+ // });
114+ // const requireStub = sandbox.stub(require('module'), '_load');
115+ // requireStub.withArgs(dependency).throws(new Error(`Cannot find module '${dependency}'`));
116+ // requireStub.callThrough();
117+
118+ // await exporter.export([], () => {});
119+ // });
120+ // });
121+ // });
122122
123123 it ( 'should not inject SigV4 headers if failure to sign headers' , async ( ) => {
124124 scope . on ( 'request' , ( req , interceptor , body ) => {
0 commit comments