Skip to content
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

Retest .clear #99

Open
NickColley opened this issue Jan 22, 2016 · 4 comments
Open

Retest .clear #99

NickColley opened this issue Jan 22, 2016 · 4 comments

Comments

@NickColley
Copy link
Contributor

We've got a skipped .clear test that was blocked on the fact that PouchDB does not reinitilize the database, but now downstream we've worked around this with a .reset method in https://github.com/hoodiehq/hoodie-client-store

What's the plan of action to fix this test? Some options:

  • See if PouchDB reiniting the database makes sense
  • Fix clear in a similar way to what we've done for .reset
  • Finally just test the fact that database no longer exists
@gr2m
Copy link
Member

gr2m commented Jan 22, 2016

I would re-initialise the PouchDB db instance in .clear() as we do with .reset() in https://github.com/hoodiehq/hoodie-client-store.

A problem I see is that we expose the db instance at store.db which will be replaced on clear, but we can add that information to the README with a "use at your own risk" note

@gr2m
Copy link
Member

gr2m commented Jan 22, 2016

strike that, I think we should no re-initialse anything on .clear(), instead do what PouchDB itself does: become unusable :) so the user has to create another instance manually if they want to add data again

@NickColley
Copy link
Contributor Author

Could we rename clear to destroy to better reflect what's going on? That conflicts with PouchDB's api though, is it necessary to have the events firing for this use case?

@gr2m
Copy link
Member

gr2m commented Feb 2, 2016

yeah I don’t mind renaming that method to .destroy(), and renaming the clear event, too. We still need a clear event in https://github.com/hoodiehq/hoodie-client-store, but that is out of scope here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants