-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Question: Is there an easy way to reset all data in the RAM database? #2
Comments
You want it to delete all object stores, or delete all data within all object stores while leaving the stores there? Because if it's the former, you could just use |
A clean slate. The idea is that each unit test should re-build everything it needs and should not be influenced by or depend on another test. That keeps is simple. Thanks for the help. I have other requests like this they seem to work. Is it possible that the call back for
|
I see you seem to be very well tested in this area in your own unit tests (via the version 1.0.3 tag) .... It must be something in my code. I'll let you know if I come up with something useful. Thanks again. |
Make sure you call db.close first, I might not be handling deleting an open
|
Yeah, there is definitely a problem with deleting databases that still have open connections. This hangs:
The same problem occurs when running a versionchange transaction on databases that still have open connections:
In both cases, the spec says something like:
But... I don't understand what is actually supposed to be closing the databases. Nothing in fakeIndexedDB does it, so it gets stuck waiting for all databases to close before proceeding. Probably it is described in the spec somewhere and I am just missing it. Maybe someone will help me. |
I had a problem getting proper deleteDatabase to work (data seemed to be there when I opened again) and no time to figure out why so I did something ugly but worked for me |
I'm using fakeIndexedDB in my unit tests. It would be great to make one method call and delete all object stores. This would be used after each test.
The text was updated successfully, but these errors were encountered: