Skip to content

Commit e4e10d5

Browse files
committed
fix how handle the storage as context data
1 parent 404dddc commit e4e10d5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/lib/find-storage.test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ const sander = require('sander')
1212
const os = require('os')
1313
const storagePath = path.join(os.tmpdir(), 'test/find-storage')
1414

15+
let storageContext
16+
1517
beforeEach(() => {
16-
t.context.storage = TestDummy.dummyStorage(storagePath)
17-
localStorage.setItem('storages', JSON.stringify([t.context.storage.cache]))
18+
storageContext = TestDummy.dummyStorage(storagePath)
19+
localStorage.setItem('storages', JSON.stringify([storageContext.cache]))
1820
})
1921

2022
// Unit test
2123
test('findStorage() should return a correct storage path(string)', () => {
22-
const storageKey = t.context.storage.cache.key
24+
const storageKey = storageContext.cache.key
2325

2426
expect(findStorage(storageKey).key).toBe(storageKey)
2527
expect(findStorage(storageKey).path).toBe(storagePath)

0 commit comments

Comments
 (0)