Skip to content

Commit

Permalink
test(credential-provider-cognito-identity): compat for Node.js 18 (#4817
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kuhe committed Jun 9, 2023
1 parent 28aae5c commit bb6e4fc
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ describe("localStorage", () => {

beforeEach(() => {
if (window) {
(window.localStorage as any) = undefined;
Object.defineProperty(window, "localStorage", {
writable: true,
configurable: true,
enumerable: true,
value: undefined,
});
}

if (self) {
Expand All @@ -20,7 +25,12 @@ describe("localStorage", () => {

afterEach(() => {
if (window) {
(window.localStorage as any) = storageAtInit;
Object.defineProperty(window, "localStorage", {
writable: true,
configurable: true,
enumerable: true,
value: storageAtInit,
});
}

if (self) {
Expand Down

0 comments on commit bb6e4fc

Please sign in to comment.