diff --git a/test/browser.js b/test/browser.js index 8792239d..6fbd837b 100644 --- a/test/browser.js +++ b/test/browser.js @@ -14,7 +14,7 @@ const idb = window.indexedDB || window.msIndexedDB // book keeping -const dbs = [] +let dbs = [] function createRepo (id, done) { const repoData = [] @@ -55,6 +55,7 @@ function removeRepos (done) { idb.deleteDatabase(db) idb.deleteDatabase(`${db}/blocks`) }) + dbs = [] done() } diff --git a/test/node.js b/test/node.js index f109f698..1147b46a 100644 --- a/test/node.js +++ b/test/node.js @@ -9,7 +9,7 @@ const testRepoPath = path.join(__dirname, 'test-repo') const each = require('async/each') // book keeping -const repos = [] +let repos = [] function createRepo (id, done) { const date = Date.now().toString() @@ -26,7 +26,10 @@ function createRepo (id, done) { function removeRepos (done) { each(repos, (repo, cb) => { rimraf(repo, cb) - }, done) + }, (err) => { + repos = [] + done(err) + }) } const repo = {