Skip to content

Instantly share code, notes, and snippets.

@yoav-lavi
Created October 15, 2019 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoav-lavi/d93cd8377f7f7294bf7e2f98d55bdd8b to your computer and use it in GitHub Desktop.
Save yoav-lavi/d93cd8377f7f7294bf7e2f98d55bdd8b to your computer and use it in GitHub Desktop.
Tests for store.js
const createStore = importModule('store');
const { describe } = importModule('test');
const store = createStore('store-test');
await describe('Store', async test => {
const key = 'key';
const value = 'value';
await test('Saves and retrieves a value', async () => {
store.set(key, value);
const storedValue = store.get(key);
return storedValue === value;
});
store.remove(key);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment