Skip to content

Commit

Permalink
Run abstract-leveldown tests on levelup interface (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers authored Apr 11, 2020
1 parent b53770c commit 8928189
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"test": "test"
},
"dependencies": {
"abstract-leveldown": "^6.2.3",
"abstract-leveldown": "^6.3.0",
"encoding-down": "^6.2.0",
"inherits": "^2.0.3",
"level-option-wrap": "^1.1.0",
"levelup": "^4.3.1",
"levelup": "^4.4.0",
"reachdown": "^1.1.0"
},
"devDependencies": {
Expand Down
22 changes: 22 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,28 @@ runSuite(function factory () {
return subdown(down, 'test')
})

// Test levelup interface
suite({
test: test,
factory: function () {
// This is a levelup instance, but we're testing it as abstract-leveldown :)
return subdb(levelup(encoding(memdown())), 'test')
},
// Unsupported features
seek: false,
createIfMissing: false,
errorIfExists: false,

// Opt-in to new clear() tests
clear: true,

// Adapt for levelup
promises: true,
status: false,
serialize: false,
encodings: true
})

// Additional tests for this implementation
test('SubDown constructor', function (t) {
t.test('can be called without new', function (t) {
Expand Down

0 comments on commit 8928189

Please sign in to comment.