Skip to content

Commit

Permalink
test: fix repo cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Sep 9, 2016
1 parent 1f18434 commit 0b53585
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const idb = window.indexedDB ||
window.msIndexedDB

// book keeping
const dbs = []
let dbs = []

function createRepo (id, done) {
const repoData = []
Expand Down Expand Up @@ -55,6 +55,7 @@ function removeRepos (done) {
idb.deleteDatabase(db)
idb.deleteDatabase(`${db}/blocks`)
})
dbs = []
done()
}

Expand Down
7 changes: 5 additions & 2 deletions test/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 = {
Expand Down

0 comments on commit 0b53585

Please sign in to comment.