Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

make testCommon.js the default value for testCommon parameter + remove testBuffer #175

Merged
merged 2 commits into from
Jan 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions abstract/batch-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ module.exports.tearDown = function (test, testCommon) {
}

module.exports.all = function (leveldown, test, testCommon) {
testCommon = testCommon || require('../testCommon')
module.exports.setUp(leveldown, test, testCommon)
module.exports.args(test)
module.exports.batch(test)
Expand Down
1 change: 1 addition & 0 deletions abstract/chained-batch-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ module.exports.tearDown = function (test, testCommon) {
}

module.exports.all = function (leveldown, test, testCommon) {
testCommon = testCommon || require('../testCommon')
module.exports.setUp(leveldown, test, testCommon)
module.exports.args(test)
module.exports.batch(test, testCommon)
Expand Down
1 change: 1 addition & 0 deletions abstract/close-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports.close = function (leveldown, test, testCommon) {
testCommon = testCommon || require('../testCommon')
test('test close()', function (t) {
var db = leveldown(testCommon.location())

Expand Down
1 change: 1 addition & 0 deletions abstract/del-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ module.exports.tearDown = function (test, testCommon) {
}

module.exports.all = function (leveldown, test, testCommon) {
testCommon = testCommon || require('../testCommon')
module.exports.setUp(leveldown, test, testCommon)
module.exports.args(test)
module.exports.del(test)
Expand Down
1 change: 1 addition & 0 deletions abstract/get-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ module.exports.tearDown = function (test, testCommon) {
}

module.exports.all = function (leveldown, test, testCommon) {
testCommon = testCommon || require('../testCommon')
module.exports.setUp(leveldown, test, testCommon)
module.exports.args(test)
module.exports.get(test)
Expand Down
2 changes: 2 additions & 0 deletions abstract/iterator-range-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ module.exports.tearDown = function (test, testCommon) {
}

module.exports.all = function (leveldown, test, testCommon) {
testCommon = testCommon || require('../testCommon')

var data = (function () {
var d = []
var i = 0
Expand Down
1 change: 1 addition & 0 deletions abstract/iterator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ module.exports.tearDown = function (test, testCommon) {
}

module.exports.all = function (leveldown, test, testCommon) {
testCommon = testCommon || require('../testCommon')
module.exports.setUp(leveldown, test, testCommon)
module.exports.args(test)
module.exports.sequence(test)
Expand Down
1 change: 1 addition & 0 deletions abstract/open-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ module.exports.tearDown = function (test, testCommon) {
}

module.exports.all = function (leveldown, test, testCommon) {
testCommon = testCommon || require('../testCommon')
module.exports.setUp(test, testCommon)
module.exports.args(leveldown, test, testCommon)
module.exports.open(leveldown, test, testCommon)
Expand Down
14 changes: 8 additions & 6 deletions abstract/put-get-del-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var db
var verifyNotFoundError = require('./util').verifyNotFoundError
const verifyNotFoundError = require('./util').verifyNotFoundError
const testBuffer = Buffer.from('testbuffer')

function makeGetDelErrorTests (test, type, key, expectedError) {
test('test get() with ' + type + ' causes error', function (t) {
Expand Down Expand Up @@ -104,7 +105,7 @@ module.exports.errorKeys = function (test) {
makeErrorKeyTest(test, 'empty Array key', [], /key cannot be an empty String/)
}

module.exports.nonErrorKeys = function (test, testBuffer) {
module.exports.nonErrorKeys = function (test) {
// valid falsey keys
makePutGetDelSuccessfulTest(test, '`false` key', false, 'foo false')
makePutGetDelSuccessfulTest(test, '`0` key', 0, 'foo 0')
Expand All @@ -130,7 +131,7 @@ module.exports.nonErrorKeys = function (test, testBuffer) {
module.exports.errorValues = function () {
}

module.exports.nonErrorValues = function (test, testBuffer) {
module.exports.nonErrorValues = function (test) {
// valid falsey values
makePutGetDelSuccessfulTest(test, '`false` value', 'foo false', false)
makePutGetDelSuccessfulTest(test, '`0` value', 'foo 0', 0)
Expand Down Expand Up @@ -164,11 +165,12 @@ module.exports.tearDown = function (test, testCommon) {
})
}

module.exports.all = function (leveldown, test, testCommon, testBuffer) {
module.exports.all = function (leveldown, test, testCommon) {
testCommon = testCommon || require('../testCommon')
module.exports.setUp(leveldown, test, testCommon)
module.exports.errorKeys(test)
module.exports.nonErrorKeys(test, testBuffer)
module.exports.nonErrorKeys(test)
module.exports.errorValues(test)
module.exports.nonErrorValues(test, testBuffer)
module.exports.nonErrorValues(test)
module.exports.tearDown(test, testCommon)
}
1 change: 1 addition & 0 deletions abstract/put-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ module.exports.tearDown = function (test, testCommon) {
}

module.exports.all = function (leveldown, test, testCommon) {
testCommon = testCommon || require('../testCommon')
module.exports.setUp(leveldown, test, testCommon)
module.exports.args(test)
module.exports.put(test)
Expand Down