aboutsummaryrefslogtreecommitdiff
path: root/test/background/infrastructures/MemoryStorage.test.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-12-22 11:10:36 +0900
committerGitHub <noreply@github.com>2019-12-22 11:10:36 +0900
commitb1a6f374dca078dee2406ebe049715b826e37ca2 (patch)
tree5367c48648e2018f55f12d847baba94559e10040 /test/background/infrastructures/MemoryStorage.test.ts
parentb2dcdedad729ff7087867da50e20578f9fc8fb29 (diff)
parentda72c2ddd916d79d134662e3985b53a4ac78af7a (diff)
Merge pull request #690 from ueokande/eslint-and-prettier
Eslint and prettier
Diffstat (limited to 'test/background/infrastructures/MemoryStorage.test.ts')
-rw-r--r--test/background/infrastructures/MemoryStorage.test.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/background/infrastructures/MemoryStorage.test.ts b/test/background/infrastructures/MemoryStorage.test.ts
index 95d3780..ccdf9f0 100644
--- a/test/background/infrastructures/MemoryStorage.test.ts
+++ b/test/background/infrastructures/MemoryStorage.test.ts
@@ -2,7 +2,7 @@ import MemoryStorage from 'background/infrastructures/MemoryStorage';
describe("background/infrastructures/memory-storage", () => {
it('stores values', () => {
- let cache = new MemoryStorage();
+ const cache = new MemoryStorage();
cache.set('number', 123);
expect(cache.get('number')).to.equal(123);
@@ -14,7 +14,7 @@ describe("background/infrastructures/memory-storage", () => {
});
it('returns undefined if no keys', () => {
- let cache = new MemoryStorage();
+ const cache = new MemoryStorage();
expect(cache.get('no-keys')).to.be.undefined;
})
@@ -23,22 +23,22 @@ describe("background/infrastructures/memory-storage", () => {
cache.set('red', 'apple');
cache = new MemoryStorage();
- let got = cache.get('red');
+ const got = cache.get('red');
expect(got).to.equal('apple');
});
it('stored cloned objects', () => {
- let cache = new MemoryStorage();
- let recipe = { sugar: '300g' };
+ const cache = new MemoryStorage();
+ const recipe = { sugar: '300g' };
cache.set('recipe', recipe);
recipe.salt = '20g'
- let got = cache.get('recipe', recipe);
+ const got = cache.get('recipe', recipe);
expect(got).to.deep.equal({ sugar: '300g' });
});
it('throws an error with unserializable objects', () => {
- let cache = new MemoryStorage();
+ const cache = new MemoryStorage();
expect(() => cache.set('fn', setTimeout)).to.throw();
})
});