fakeIndexedDB
fakeIndexedDB copied to clipboard
A pure JS in-memory implementation of the IndexedDB API
https://github.com/dumbmatter/fakeIndexedDB/blob/4c01ec36ed2500842ad17fb606a2c6b435349ec3/src/lib/scheduling.ts#L20-L29 The code persists a reference to `globalThis.setImmediate` (which is always defined in our test setup). We have other logic (custom logic, but conceptually similar to jest's fake timers: https://jestjs.io/docs/timer-mocks)...
My draft of a fix for #92
I have the following use case for some automated tests: 1. Run a JS application which reads/writes various data from/to Fake IDB 2. Serialize the complete state of Fake IDB...
Running this in Chrome throws "Cannot set property indexedDB of #<Window> which has only a getter"
On Chrome, running `auto`, throws the error "Cannot set property indexedDB of # which has only a getter". Changing the `auto` script like so fixed the issue for me: ```diff...
When using Dexie.js, [it caches the global indexedDB variable](https://github.com/dexie/Dexie.js/blob/88f0c6bde0f76f5a7c2428b9f1b3301cb3c86841/src/classes/dexie/dexie-dom-dependencies.ts#L9), so resetting the db state won't work as expected. An easy fix is to manually handle each constructor call to explicitly...
Fix a bug https://github.com/dumbmatter/fakeIndexedDB/issues/76
To solve the problem that global Date is not same function when using in jest + jsdom or between frames.
I have a objectStore with index via a Date value. ``` const request = indexedDB.open('testDB',1); request.onupgradeneeded=()=>{ const db = request.result; const store = db.createObjectStore('testStore'); store.createIndex('dateIndex','created',{unique:false}) } ``` Add some test...