aboutsummaryrefslogtreecommitdiff
path: root/test/background/infrastructures/MemoryStorage.test.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-04-13 20:37:36 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2020-04-13 20:37:36 +0900
commite1dac618a8b8929f601c7ec8aca3842c5ebf9d03 (patch)
tree6a914a8243c8c02e7752a83667a54d3fa832955c /test/background/infrastructures/MemoryStorage.test.ts
parent685f2b7b69218b06b5bb676069e35f79c5048c9b (diff)
Use plugin:prettier/recommended
Diffstat (limited to 'test/background/infrastructures/MemoryStorage.test.ts')
-rw-r--r--test/background/infrastructures/MemoryStorage.test.ts48
1 files changed, 24 insertions, 24 deletions
diff --git a/test/background/infrastructures/MemoryStorage.test.ts b/test/background/infrastructures/MemoryStorage.test.ts
index ccdf9f0..5f8be2a 100644
--- a/test/background/infrastructures/MemoryStorage.test.ts
+++ b/test/background/infrastructures/MemoryStorage.test.ts
@@ -1,44 +1,44 @@
-import MemoryStorage from 'background/infrastructures/MemoryStorage';
+import MemoryStorage from "background/infrastructures/MemoryStorage";
describe("background/infrastructures/memory-storage", () => {
- it('stores values', () => {
+ it("stores values", () => {
const cache = new MemoryStorage();
- cache.set('number', 123);
- expect(cache.get('number')).to.equal(123);
+ cache.set("number", 123);
+ expect(cache.get("number")).to.equal(123);
- cache.set('string', '123');
- expect(cache.get('string')).to.equal('123');
+ cache.set("string", "123");
+ expect(cache.get("string")).to.equal("123");
- cache.set('object', { hello: '123' });
- expect(cache.get('object')).to.deep.equal({ hello: '123' });
+ cache.set("object", { hello: "123" });
+ expect(cache.get("object")).to.deep.equal({ hello: "123" });
});
- it('returns undefined if no keys', () => {
+ it("returns undefined if no keys", () => {
const cache = new MemoryStorage();
- expect(cache.get('no-keys')).to.be.undefined;
- })
+ expect(cache.get("no-keys")).to.be.undefined;
+ });
- it('stored on shared memory', () => {
+ it("stored on shared memory", () => {
let cache = new MemoryStorage();
- cache.set('red', 'apple');
+ cache.set("red", "apple");
cache = new MemoryStorage();
- const got = cache.get('red');
- expect(got).to.equal('apple');
+ const got = cache.get("red");
+ expect(got).to.equal("apple");
});
- it('stored cloned objects', () => {
+ it("stored cloned objects", () => {
const cache = new MemoryStorage();
- const recipe = { sugar: '300g' };
- cache.set('recipe', recipe);
+ const recipe = { sugar: "300g" };
+ cache.set("recipe", recipe);
- recipe.salt = '20g'
- const got = cache.get('recipe', recipe);
- expect(got).to.deep.equal({ sugar: '300g' });
+ recipe.salt = "20g";
+ const got = cache.get("recipe", recipe);
+ expect(got).to.deep.equal({ sugar: "300g" });
});
- it('throws an error with unserializable objects', () => {
+ it("throws an error with unserializable objects", () => {
const cache = new MemoryStorage();
- expect(() => cache.set('fn', setTimeout)).to.throw();
- })
+ expect(() => cache.set("fn", setTimeout)).to.throw();
+ });
});