You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The unit tests of credential-provider-imds throw the following error in Node.js v20.3.0:
Expected: [SyntaxError: Unexpected token . in JSON at position 0] Received: [SyntaxError: Unexpected token '.', "." is not valid JSON]
This may or may not have impact SDK usage. The unit test needs to be fixed.
SDK version number
main
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.3.0
Reproduction Steps
Run unit tests in credential-provider-imds
Observed Behavior
$ credential-provider-imds> yarn test... FAIL src/fromInstanceMetadata.spec.ts ● fromInstanceMetadata › throws SyntaxError if httpRequest returns unparseable creds expect(received).rejects.toEqual(expected) // deep equality Expected: [SyntaxError: Unexpected token . in JSON at position 0] Received: [SyntaxError: Unexpected token '.', "." is not valid JSON] 182 | (retry as jest.Mock).mockImplementation((fn: any) => fn()); 183 | > 184 | await expect(fromInstanceMetadata()()).rejects.toEqual(new SyntaxError("Unexpected token . in JSON at position 0")); | ^ 185 | expect(retry).toHaveBeenCalledTimes(2); 186 | expect(httpRequest).toHaveBeenCalledTimes(3); 187 | expect(fromImdsCredentials).not.toHaveBeenCalled(); at Object.toEqual (../../node_modules/expect/build/index.js:241:22) at src/fromInstanceMetadata.spec.ts:184:52 at src/fromInstanceMetadata.spec.ts:8:71 at Object.<anonymous>.__awaiter (src/fromInstanceMetadata.spec.ts:4:12) at Object.<anonymous> (src/fromInstanceMetadata.spec.ts:177:80) PASS src/config/EndpointConfigOptions.spec.tsA worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Active timers can also cause this, ensure that .unref() was called on them.Test Suites: 1 failed, 10 passed, 11 totalTests: 1 failed, 74 passed, 75 totalSnapshots: 0 totalTime: 4.943 sRan all test suites.error Command failed with exit code 1.
Expected Behavior
$ credential-provider-imds> yarn test...Test Suites: 11 passed, 11 totalTests: 75 passed, 75 totalSnapshots: 0 totalTime: 4.505 s, estimated 5 sRan all test suites.✨ Done in 5.04s.
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered:
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Checkboxes for prior research
Describe the bug
The unit tests of
credential-provider-imds
throw the following error in Node.js v20.3.0:This may or may not have impact SDK usage. The unit test needs to be fixed.
SDK version number
main
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.3.0
Reproduction Steps
Run unit tests in
credential-provider-imds
Observed Behavior
Expected Behavior
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: