From 89281892ad47336ca471741a5959e60f818ecf61 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sat, 11 Apr 2020 10:36:35 +0300 Subject: [PATCH] Run abstract-leveldown tests on levelup interface (#90) --- package.json | 4 ++-- test/index.js | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1c6cd04..c4fe029 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/test/index.js b/test/index.js index bdd76d1..c596d92 100644 --- a/test/index.js +++ b/test/index.js @@ -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) {