mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-05-31 19:26:37 +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')
|
orbitdb2 = new OrbitDB(ipfs2, './orbitdb/2')
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(async () => {
|
||||||
if (orbitdb1)
|
if (orbitdb1)
|
||||||
orbitdb1.stop()
|
await orbitdb1.stop()
|
||||||
|
|
||||||
if (orbitdb2)
|
if (orbitdb2)
|
||||||
orbitdb2.stop()
|
await orbitdb2.stop()
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('counters', function() {
|
describe('counters', function() {
|
||||||
|
@ -31,7 +31,7 @@ describe('orbit-db - Create & Open', function() {
|
|||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
if(orbitdb)
|
if(orbitdb)
|
||||||
orbitdb.stop()
|
await orbitdb.stop()
|
||||||
|
|
||||||
if (ipfs)
|
if (ipfs)
|
||||||
await ipfs.stop()
|
await ipfs.stop()
|
||||||
|
@ -36,7 +36,7 @@ describe('orbit-db - Create custom type', function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
if(orbitdb) orbitdb.stop()
|
if (orbitdb) await orbitdb.stop()
|
||||||
if (ipfs) await ipfs.stop()
|
if (ipfs) await ipfs.stop()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ describe('orbit-db - Drop Database', function() {
|
|||||||
|
|
||||||
after(async () => {
|
after(async () => {
|
||||||
if(orbitdb)
|
if(orbitdb)
|
||||||
orbitdb.stop()
|
await orbitdb.stop()
|
||||||
|
|
||||||
if (ipfs)
|
if (ipfs)
|
||||||
await ipfs.stop()
|
await ipfs.stop()
|
||||||
@ -45,6 +45,6 @@ describe('orbit-db - Drop Database', function() {
|
|||||||
it('removes local database files', async () => {
|
it('removes local database files', async () => {
|
||||||
await db.drop()
|
await db.drop()
|
||||||
assert.equal(fs.existsSync(localDataPath), false)
|
assert.equal(fs.existsSync(localDataPath), false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user