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

Add tests #4

Closed
agilgur5 opened this issue Jul 7, 2019 · 2 comments · Fixed by #21
Closed

Add tests #4

agilgur5 opened this issue Jul 7, 2019 · 2 comments · Fixed by #21
Labels
kind: internal Changes only affect the internal API scope: tests

Comments

@agilgur5
Copy link
Owner

agilgur5 commented Jul 7, 2019

Noting that I'll likely need to mock out localStorage for tests. Not difficult given that a simple mock can be < 10 LoC (or use some in-memory package).

Unlike Jest, AVA doesn't support mocking out-of-the-box, but we don't really need sinon or too much mocking support for a small mock like this, so should be nbd

@agilgur5
Copy link
Owner Author

Make sure to add a localForage integration test to ensure all versions must support it. Any future IStorage interface should also work with localForage's interface and the typed test should guarantee that if it compiles.

@agilgur5
Copy link
Owner Author

Still need to add a localForage integration test, but just wanted to note here that per the PR that adds tests, jsdom actually has a localStorage implementation built-in, so there was no need to polyfill/mock that. Though polyfilling it and running entirely in a node environment would likely make the tests run a bit faster as there wouldn't be a need to initialize jsdom anymore then.

@agilgur5 agilgur5 added the kind: internal Changes only affect the internal API label Jul 19, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: internal Changes only affect the internal API scope: tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant