-
-
Notifications
You must be signed in to change notification settings - Fork 267
/
self.js
55 lines (49 loc) · 1.16 KB
/
self.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'use strict'
const test = require('tape')
const memdown = require('memdown')
const encode = require('encoding-down')
const levelup = require('../lib/levelup')
const suite = require('.')
const noop = function () {}
suite({
test: test,
factory: function (options) {
return levelup(encode(memdown(), options))
},
clear: true,
deferredOpen: true,
promises: true,
streams: true,
encodings: true
})
suite({
test: test,
factory: function (options) {
return levelup(memdown(), options)
},
clear: true,
deferredOpen: true,
promises: true,
streams: true,
encodings: false
})
// TODO to make this pass:
// - Have abstract-leveldown use level-errors
// - Perform type checks in same order (e.g. check key before callback)
// - Add db.isClosed(), isOpen() to abstract-leveldown
suite({
test: noop,
factory: function (options) {
return memdown()
},
clear: true,
deferredOpen: false,
promises: false,
streams: false,
encodings: false
})
// Integration tests that can't use a generic testCommon.factory()
require('./self/manifest-test')
if (typeof process === 'undefined' || !process.browser) {
require('./browserify-test')(test)
}