-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transactions/Cursors fail with jsdom
#67
Comments
Thanks for the repo with a reproduction! It does seem like it could be related to #64... but if I put Anyone have any ideas? If it was as simple as using real timers, I could do it like suggested in #64 probably, but it doesn't seem to be that simple... |
The problem seems to be here: fakeIndexedDB/src/FDBDatabase.ts Line 220 in be0551e
This starts and completes the transaction per
I've confirmed the following workaround in the repro:
Would it be feasible to use |
In general it is difficult to switch between the timing functions as described in #64. It may be possible in this specific case, I'm not sure, but before I even get there... it doesn't seem to help here. You are correct that Like... any idea about why |
There are no fake timers in place. Replacing The clean solution might be to configure the timer to be used per setup. import { setNextMacroTask } from 'fake-indexeddb/auto'
setNextMacroTask(setTimeout) |
After update from v3.1.3 to v3.1.4 that contains only this fix, my Mocha tests started failing 😢 |
With
jsdom
environment injest@27
acting on a transaction after allowing other code to run (perawait
) throws errors.This differs from executing the same calls in a
node
environment.Maybe this is related to #64
https://github.com/ph-fritsche/repro-jest-jsdom-indexeddb
The text was updated successfully, but these errors were encountered: