Skip to content

Commit f2ad373

Browse files
committed
Use promise API of db.open() and close() in tests
1 parent 43ba6b7 commit f2ad373

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

test/index.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const shape = require('./shape')
44
const cloneable = require('./cloneable')
55

66
module.exports = function suite (test, testCommon) {
7-
test('db has manifest', function (t) {
7+
test('db has manifest', async function (t) {
88
const db = testCommon.factory()
99
const manifest = db.supports
1010

@@ -15,15 +15,10 @@ module.exports = function suite (test, testCommon) {
1515
additionalMethods: Object.assign({}, manifest.additionalMethods)
1616
})
1717

18-
db.open(function (err) {
19-
t.ifError(err, 'no open error')
20-
t.same(db.supports, before, 'manifest did not change after open')
18+
await db.open()
19+
t.same(db.supports, before, 'manifest did not change after open')
2120

22-
db.close(function (err) {
23-
t.ifError(err, 'no close error')
24-
t.same(db.supports, before, 'manifest did not change after close')
25-
t.end()
26-
})
27-
})
21+
await db.close()
22+
t.same(db.supports, before, 'manifest did not change after close')
2823
})
2924
}

0 commit comments

Comments
 (0)