From e4e10d523fac38f256d0b2e1af613badd3c015da Mon Sep 17 00:00:00 2001 From: amedora Date: Wed, 7 Aug 2019 14:52:17 +0900 Subject: [PATCH] fix how handle the storage as context data --- tests/lib/find-storage.test.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/lib/find-storage.test.js b/tests/lib/find-storage.test.js index 0504881a..77a7ca64 100644 --- a/tests/lib/find-storage.test.js +++ b/tests/lib/find-storage.test.js @@ -12,14 +12,16 @@ const sander = require('sander') const os = require('os') const storagePath = path.join(os.tmpdir(), 'test/find-storage') +let storageContext + beforeEach(() => { - t.context.storage = TestDummy.dummyStorage(storagePath) - localStorage.setItem('storages', JSON.stringify([t.context.storage.cache])) + storageContext = TestDummy.dummyStorage(storagePath) + localStorage.setItem('storages', JSON.stringify([storageContext.cache])) }) // Unit test test('findStorage() should return a correct storage path(string)', () => { - const storageKey = t.context.storage.cache.key + const storageKey = storageContext.cache.key expect(findStorage(storageKey).key).toBe(storageKey) expect(findStorage(storageKey).path).toBe(storagePath)