You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

28 lines
809 B

import * as storage from 'shared/versions/storage';
describe("shared/versions/storage", () => {
describe('#load', () => {
beforeEach(() => {
return browser.storage.local.remove('version');
});
it('loads saved version', async() => {
await browser.storage.local.set({ version: '1.2.3' });
let version = await storage.load();
expect(version).to.equal('1.2.3');
});
it('returns undefined if no versions in storage', async() => {
let version = await storage.load();
expect(version).to.be.a('undefined');
});
});
describe('#save', () => {
it('saves version string', async() => {
await storage.save('2.3.4');
let { version } = await browser.storage.local.get('version');
expect(version).to.equal('2.3.4');
});
});
});