-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup-test.ts
32 lines (30 loc) · 862 Bytes
/
setup-test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import fakeIndexDb, {
IDBCursor,
IDBCursorWithValue,
IDBDatabase,
IDBIndex,
IDBKeyRange,
IDBObjectStore,
IDBOpenDBRequest,
IDBRequest,
IDBTransaction,
IDBVersionChangeEvent,
} from "fake-indexeddb";
import { Path2D } from "path2d";
if (!globalThis.indexdDB) {
globalThis.indexedDB = fakeIndexDb;
globalThis.IDBRequest = IDBRequest;
globalThis.IDBCursor = IDBCursor;
globalThis.IDBCursorWithValue = IDBCursorWithValue;
globalThis.IDBDatabase = IDBDatabase;
globalThis.IDBIndex = IDBIndex;
globalThis.IDBKeyRange = IDBKeyRange;
globalThis.IDBObjectStore = IDBObjectStore;
globalThis.IDBOpenDBRequest = IDBOpenDBRequest;
globalThis.IDBRequest = IDBRequest;
globalThis.IDBTransaction = IDBTransaction;
globalThis.IDBVersionChangeEvent = IDBVersionChangeEvent;
}
if (!globalThis.Path2D) {
globalThis.Path2D = Path2D;
}