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 middleware-socket throw the following error:
TypeError: Cannot redefine property: localStorage
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
18.16.0
Reproduction Steps
Run credential-provider-cognito-identity unit tests in Node.js 18.16.0
Observed Behavior
$ credential-provider-cognito-identity> yarn test... FAIL src/localStorage.spec.ts ● localStorage › should return an IndexedDB-backed cache if possible TypeError: Cannot redefine property: localStorage 11 | beforeEach(() => { 12 | if (window) { > 13 | (window.localStorage as any) = undefined; | ^ 14 | } 15 | 16 | if (self) { at Object.<anonymous> (src/localStorage.spec.ts:13:35) ● localStorage › should return an IndexedDB-backed cache if possible TypeError: Cannot redefine property: localStorage 21 | afterEach(() => { 22 | if (window) { > 23 | (window.localStorage as any) = storageAtInit; | ^ 24 | } 25 | 26 | if (self) { at Object.<anonymous> (src/localStorage.spec.ts:23:35) ● localStorage › should return window.localStorage if IndexedDB is undefined but localStorage is available TypeError: Cannot redefine property: localStorage 11 | beforeEach(() => { 12 | if (window) { > 13 | (window.localStorage as any) = undefined; | ^ 14 | } 15 | 16 | if (self) { at Object.<anonymous> (src/localStorage.spec.ts:13:35) ● localStorage › should return window.localStorage if IndexedDB is undefined but localStorage is available TypeError: Cannot redefine property: localStorage 21 | afterEach(() => { 22 | if (window) { > 23 | (window.localStorage as any) = storageAtInit; | ^ 24 | } 25 | 26 | if (self) { at Object.<anonymous> (src/localStorage.spec.ts:23:35) PASS src/fromCognitoIdentity.spec.ts PASS src/fromCognitoIdentityPool.spec.tsTest Suites: 1 failed, 1 skipped, 5 passed, 6 of 7 totalTests: 2 failed, 3 skipped, 20 passed, 25 totalSnapshots: 0 totalTime: 3.723 sRan all test suites.error Command failed with exit code 1.
Expected Behavior
$ credential-provider-cognito-identity> yarn test...Test Suites: 1 skipped, 6 passed, 6 of 7 totalTests: 3 skipped, 22 passed, 25 totalSnapshots: 0 totalTime: 3.262 s, estimated 4 sRan all test suites.✨ Done in 3.76s.
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered:
trivikr
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
p2
This is a standard priority issue
queued
This issues is on the AWS team's backlog
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Jun 8, 2023
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 middleware-socket throw the following error:
TypeError: Cannot redefine property: localStorage
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
18.16.0
Reproduction Steps
Run credential-provider-cognito-identity unit tests in Node.js 18.16.0
Observed Behavior
Expected Behavior
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: