aboutsummaryrefslogtreecommitdiff
path: root/test/shared/versions/storage.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/shared/versions/storage.test.js')
-rw-r--r--test/shared/versions/storage.test.js33
1 files changed, 11 insertions, 22 deletions
diff --git a/test/shared/versions/storage.test.js b/test/shared/versions/storage.test.js
index bcfa259..f541abf 100644
--- a/test/shared/versions/storage.test.js
+++ b/test/shared/versions/storage.test.js
@@ -6,34 +6,23 @@ describe("shared/versions/storage", () => {
return browser.storage.local.remove('version');
});
- it('loads saved version', () => {
- return Promise.resolve().then(() => {
- return browser.storage.local.set({ version: '1.2.3' });
- }).then(() => {
- return storage.load();
- }).then((version) => {
- expect(version).to.equal('1.2.3');
- });
+ 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', () => {
- return Promise.resolve().then(() => {
- return storage.load();
- }).then((version) => {
- expect(version).to.be.a('undefined');
- });
+ 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', () => {
- return Promise.resolve().then(() => {
- return storage.save('2.3.4');
- }).then(() => {
- return browser.storage.local.get('version');
- }).then(({version}) => {
- expect(version).to.equal('2.3.4');
- });
+ 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');
});
});
});