Skip to content

Commit

Permalink
Use promise API of db.open() and close() in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Nov 9, 2022
1 parent 43ba6b7 commit f2ad373
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const shape = require('./shape')
const cloneable = require('./cloneable')

module.exports = function suite (test, testCommon) {
test('db has manifest', function (t) {
test('db has manifest', async function (t) {
const db = testCommon.factory()
const manifest = db.supports

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

db.open(function (err) {
t.ifError(err, 'no open error')
t.same(db.supports, before, 'manifest did not change after open')
await db.open()
t.same(db.supports, before, 'manifest did not change after open')

db.close(function (err) {
t.ifError(err, 'no close error')
t.same(db.supports, before, 'manifest did not change after close')
t.end()
})
})
await db.close()
t.same(db.supports, before, 'manifest did not change after close')
})
}

0 comments on commit f2ad373

Please sign in to comment.