Skip to content

Commit 950284e

Browse files
committed
fix(credential-provider-cognito-identity): tests to bump jest to v27
1 parent efeaf5d commit 950284e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

packages/credential-provider-cognito-identity/src/localStorage-inmemoryStorage.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@ import { InMemoryStorage } from "./InMemoryStorage";
22
import { localStorage as storage } from "./localStorage";
33

44
describe("localStorage", () => {
5+
let self: any = {}; // eslint-disable-line prefer-const
6+
let window: any = {}; // eslint-disable-line prefer-const
7+
58
// set store and restore indexedDB and localStorage before and after the test
69
let indexDB: any = undefined;
710
let localStorage: any = undefined;
11+
812
beforeEach(() => {
913
if (typeof self === "object") indexDB = self.indexedDB;
1014
if (typeof window === "object") localStorage = window.localStorage;
1115
});
16+
1217
afterEach(() => {
1318
if (typeof self === "object") defineProperty(self, "indexedDB", indexDB);
1419
if (typeof window === "object") defineProperty(window, "localStorage", localStorage);
1520
});
21+
1622
it("should return an in-memory storage implementation when indexDB or localStorage is not available", () => {
1723
defineProperty(self, "indexedDB", null);
1824
defineProperty(window, "localStorage", null);

packages/credential-provider-cognito-identity/src/localStorage.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* @jest-environment jsdom
3+
*/
14
import { IndexedDbStorage } from "./IndexedDbStorage";
25
import { localStorage } from "./localStorage";
36

0 commit comments

Comments
 (0)