mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-05-30 10:46:36 +00:00
Wait for database to close in tests
This commit is contained in:
parent
51b79745a7
commit
40dc6e4340
@ -51,12 +51,12 @@ describe('CounterStore', function() {
|
||||
orbitdb2 = new OrbitDB(ipfs2, './orbitdb/2')
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
afterEach(async () => {
|
||||
if (orbitdb1)
|
||||
orbitdb1.stop()
|
||||
await orbitdb1.stop()
|
||||
|
||||
if (orbitdb2)
|
||||
orbitdb2.stop()
|
||||
await orbitdb2.stop()
|
||||
})
|
||||
|
||||
describe('counters', function() {
|
||||
|
@ -31,7 +31,7 @@ describe('orbit-db - Create & Open', function() {
|
||||
|
||||
after(async () => {
|
||||
if(orbitdb)
|
||||
orbitdb.stop()
|
||||
await orbitdb.stop()
|
||||
|
||||
if (ipfs)
|
||||
await ipfs.stop()
|
||||
|
@ -36,7 +36,7 @@ describe('orbit-db - Create custom type', function () {
|
||||
})
|
||||
|
||||
after(async () => {
|
||||
if(orbitdb) orbitdb.stop()
|
||||
if (orbitdb) await orbitdb.stop()
|
||||
if (ipfs) await ipfs.stop()
|
||||
})
|
||||
|
||||
|
@ -27,7 +27,7 @@ describe('orbit-db - Drop Database', function() {
|
||||
|
||||
after(async () => {
|
||||
if(orbitdb)
|
||||
orbitdb.stop()
|
||||
await orbitdb.stop()
|
||||
|
||||
if (ipfs)
|
||||
await ipfs.stop()
|
||||
@ -45,6 +45,6 @@ describe('orbit-db - Drop Database', function() {
|
||||
it('removes local database files', async () => {
|
||||
await db.drop()
|
||||
assert.equal(fs.existsSync(localDataPath), false)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user