1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 18:56:22 +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')
@@ -16,30 +19,32 @@ const CSON = require('@rokt33r/season')
const storagePath = path.join(os.tmpdir(), 'test/create-folder')
test.beforeEach((t) => {
test.beforeEach(t => {
t.context.storage = TestDummy.dummyStorage(storagePath)
localStorage.setItem('storages', JSON.stringify([t.context.storage.cache]))
})
test.serial('Create a folder', (t) => {
test.serial('Create a folder', t => {
const storageKey = t.context.storage.cache.key
const input = {
name: 'created',
color: '#ff5555'
}
return Promise.resolve()
.then(function doTest () {
.then(function doTest() {
return createFolder(storageKey, input)
})
.then(function assert (data) {
.then(function assert(data) {
t.true(_.find(data.storage.folders, input) != null)
const jsonData = CSON.readFileSync(path.join(data.storage.path, 'boostnote.json'))
const jsonData = CSON.readFileSync(
path.join(data.storage.path, 'boostnote.json')
)
console.log(path.join(data.storage.path, 'boostnote.json'))
t.true(_.find(jsonData.folders, input) != null)
})
})
test.after(function after () {
test.after(function after() {
localStorage.clear()
sander.rimrafSync(storagePath)
})