diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-07-03 06:49:33 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-07-03 06:49:33 +0800 |
commit | a8f745f9fe74751b87f500af3857b66d4c80f45e (patch) | |
tree | f4f09d2b4227b35a6d2fd996113d36a8aa658ddd /mascara/test | |
parent | cc11a623972acf707291d7b42d9dc2f8d7006e20 (diff) | |
download | tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar.gz tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar.bz2 tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar.lz tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar.xz tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.tar.zst tangerine-wallet-browser-a8f745f9fe74751b87f500af3857b66d4c80f45e.zip |
eslint --fix .
Diffstat (limited to 'mascara/test')
-rw-r--r-- | mascara/test/helpers.js | 6 | ||||
-rw-r--r-- | mascara/test/index.js | 8 | ||||
-rw-r--r-- | mascara/test/util/mascara-test-helper.js | 9 |
3 files changed, 12 insertions, 11 deletions
diff --git a/mascara/test/helpers.js b/mascara/test/helpers.js index eede103b4..08a0a9a7f 100644 --- a/mascara/test/helpers.js +++ b/mascara/test/helpers.js @@ -1,6 +1,6 @@ -function wait(time) { - return new Promise(function(resolve, reject) { - setTimeout(function() { +function wait (time) { + return new Promise(function (resolve, reject) { + setTimeout(function () { resolve() }, time * 3 || 1500) }) diff --git a/mascara/test/index.js b/mascara/test/index.js index 0134cdf00..d62e43705 100644 --- a/mascara/test/index.js +++ b/mascara/test/index.js @@ -1,9 +1,9 @@ var fs = require('fs') var path = require('path') -var browserify = require('browserify'); +var browserify = require('browserify') var tests = fs.readdirSync(path.join(__dirname, 'lib')) var bundlePath = path.join(__dirname, 'test-bundle.js') -var b = browserify(); +var b = browserify() // Remove old bundle try { @@ -14,9 +14,9 @@ try { var writeStream = fs.createWriteStream(bundlePath) -tests.forEach(function(fileName) { +tests.forEach(function (fileName) { b.add(path.join(__dirname, 'lib', fileName)) }) -b.bundle().pipe(writeStream); +b.bundle().pipe(writeStream) diff --git a/mascara/test/util/mascara-test-helper.js b/mascara/test/util/mascara-test-helper.js index 9cf4fa900..c40b57300 100644 --- a/mascara/test/util/mascara-test-helper.js +++ b/mascara/test/util/mascara-test-helper.js @@ -16,13 +16,14 @@ module.exports = class Helper extends EventEmitter { unregister () { return global.navigator.serviceWorker.getRegistration() .then((registration) => { - if (registration) return registration.unregister() + if (registration) { + return registration.unregister() .then((b) => b ? Promise.resolve() : Promise.reject()) - else return Promise.resolve() +} else return Promise.resolve() }) } clearDb () { - return new Promise ((resolve, reject) => { + return new Promise((resolve, reject) => { const deleteRequest = global.indexDB.deleteDatabase(KEY) deleteRequest.addEventListener('success', resolve) deleteRequest.addEventListener('error', reject) @@ -33,7 +34,7 @@ module.exports = class Helper extends EventEmitter { const db = new IDB({ version: 2, key: KEY, - initialState: state + initialState: state, }) return db.open() } |