From f2ad373b2e1cfccd95850514bd90fb584f259847 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Wed, 9 Nov 2022 20:18:08 +0100 Subject: [PATCH] Use promise API of db.open() and close() in tests --- test/index.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/test/index.js b/test/index.js index 0208416..ea8ee5d 100644 --- a/test/index.js +++ b/test/index.js @@ -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 @@ -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') }) }