1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

fixed eslint error & integrated with prettier as well as formatted the whole codebase (#3450)

This commit is contained in:
Nguyen Viet Hung
2020-02-05 13:28:27 +13:00
committed by GitHub
parent 051ce9e208
commit 592aca1539
186 changed files with 9233 additions and 5565 deletions

View File

@@ -6,7 +6,10 @@ global.window = document.defaultView
global.navigator = window.navigator
const Storage = require('dom-storage')
const localStorage = window.localStorage = global.localStorage = new Storage(null, { strict: true })
const localStorage = (window.localStorage = global.localStorage = new Storage(
null,
{ strict: true }
))
const path = require('path')
const _ = require('lodash')
const TestDummy = require('../fixtures/TestDummy')
@@ -15,24 +18,24 @@ const os = require('os')
const storagePath = path.join(os.tmpdir(), 'test/toggle-storage')
test.beforeEach((t) => {
test.beforeEach(t => {
t.context.storage = TestDummy.dummyStorage(storagePath)
localStorage.setItem('storages', JSON.stringify([t.context.storage.cache]))
})
test.serial('Toggle a storage location', (t) => {
test.serial('Toggle a storage location', t => {
const storageKey = t.context.storage.cache.key
return Promise.resolve()
.then(function doTest () {
.then(function doTest() {
return toggleStorage(storageKey, true)
})
.then(function assert (data) {
.then(function assert(data) {
const cachedStorageList = JSON.parse(localStorage.getItem('storages'))
t.true(_.find(cachedStorageList, {key: storageKey}).isOpen === true)
t.true(_.find(cachedStorageList, { key: storageKey }).isOpen === true)
})
})
test.after(function after () {
test.after(function after() {
localStorage.clear()
sander.rimrafSync(storagePath)
})