From 77fe1c795f494dec47efb2b6b80eff7203844ffb Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Sat, 23 Dec 2017 18:05:46 +0100 Subject: [PATCH] put back t.plan() in custom _serialize tests --- abstract/approximate-size-test.js | 6 ++---- abstract/del-test.js | 6 ++---- abstract/get-test.js | 6 ++---- abstract/put-test.js | 6 ++---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/abstract/approximate-size-test.js b/abstract/approximate-size-test.js index 5fc43d57..8ae2221b 100644 --- a/abstract/approximate-size-test.js +++ b/abstract/approximate-size-test.js @@ -68,6 +68,7 @@ module.exports.args = function (test) { }) test('test custom _serialize*', function (t) { + t.plan(4) var db = leveldown(testCommon.location()) db._serializeKey = function (data) { return data } db._approximateSize = function (start, end, callback) { @@ -78,10 +79,7 @@ module.exports.args = function (test) { db.open(function () { db.approximateSize({ foo: 'bar' }, { beep: 'boop' }, function (err) { t.error(err) - db.close(function (err) { - t.error(err) - t.end() - }) + db.close(t.error.bind(t)) }) }) }) diff --git a/abstract/del-test.js b/abstract/del-test.js index b5ff2505..825cc19e 100644 --- a/abstract/del-test.js +++ b/abstract/del-test.js @@ -42,6 +42,7 @@ module.exports.args = function (test) { }) test('test custom _serialize*', function (t) { + t.plan(3) var db = leveldown(testCommon.location()) db._serializeKey = function (data) { return data } db._del = function (key, options, callback) { @@ -51,10 +52,7 @@ module.exports.args = function (test) { db.open(function () { db.del({ foo: 'bar' }, function (err) { t.error(err) - db.close(function (err) { - t.error(err) - t.end() - }) + db.close(t.error.bind(t)) }) }) }) diff --git a/abstract/get-test.js b/abstract/get-test.js index f5bd9700..755651e4 100644 --- a/abstract/get-test.js +++ b/abstract/get-test.js @@ -43,6 +43,7 @@ module.exports.args = function (test) { }) test('test custom _serialize*', function (t) { + t.plan(3) var db = leveldown(testCommon.location()) db._serializeKey = function (data) { return data } db._get = function (key, options, callback) { @@ -52,10 +53,7 @@ module.exports.args = function (test) { db.open(function () { db.get({ foo: 'bar' }, function (err) { t.error(err) - db.close(function (err) { - t.error(err) - t.end() - }) + db.close(t.error.bind(t)) }) }) }) diff --git a/abstract/put-test.js b/abstract/put-test.js index 36080790..58d9fe75 100644 --- a/abstract/put-test.js +++ b/abstract/put-test.js @@ -64,6 +64,7 @@ module.exports.args = function (test) { }) test('test custom _serialize*', function (t) { + t.plan(4) var db = leveldown(testCommon.location()) db._serializeKey = db._serializeValue = function (data) { return data } db._put = function (key, value, options, callback) { @@ -74,10 +75,7 @@ module.exports.args = function (test) { db.open(function () { db.put({ foo: 'bar' }, { beep: 'boop' }, function (err) { t.error(err) - db.close(function (err) { - t.error(err) - t.end() - }) + db.close(t.error.bind(t)) }) }) })