From 0b53585b245d13d3af95df44f2c1c47560ac1bbf Mon Sep 17 00:00:00 2001 From: Friedel Ziegelmayer Date: Fri, 9 Sep 2016 12:14:19 +0200 Subject: [PATCH] test: fix repo cleanup --- test/browser.js | 3 ++- test/node.js | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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 = {