Skip to content

Commit e0c0748

Browse files
committed
Test get through LevelUP.
Closes #106.
1 parent d7136ef commit e0c0748

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
"devDependencies":
4747
{
4848
"proof": "0.0.41",
49-
"tap": "*"
49+
"tap": "*",
50+
"levelup": "0.18.2"
5051
},
5152
"scripts":
5253
{

release.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ to build other databases.
77

88
### Issue by Issue
99

10+
* Test get through LevelUP. #106.
1011
* Implement `Locket.approximateSize`. #104.
1112
* Upgrade Skip to 0.0.6. #103.
1213
* Extract Dilute creation to Locket object. #102.

t/locket/get.t.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@ require('proof')(2, function (step, equal, deepEqual) {
1717
step(function () {
1818
rimraf(location, step())
1919
}, function () {
20-
locket = new Locket(location)
21-
locket.open({ createIfMissing: true }, step())
20+
locket = require('levelup')(location, { db: Locket })
21+
locket.open(step())
2222
}, [function () {
2323
locket.get('a', step())
2424
}, function (_, error) {
25-
equal(error.message, 'NotFoundError: not found', 'get empty')
25+
equal(error.status, 404, 'get empty')
2626
}])
2727
}, function () {
2828
var location = path.join(tmp, 'put')
2929
var locket
3030
step(function () {
3131
rimraf(location, step())
3232
}, function () {
33-
locket = new Locket(location)
34-
locket.open({ createIfMissing: true }, step())
33+
locket = require('levelup')(location, { db: Locket })
34+
locket.open(step())
3535
}, function () {
3636
locket.put('b', JSON.stringify({ value: 1 }), step())
3737
}, [function () {
3838
locket.get('a', step())
3939
}, function (_, error) {
40-
equal(error.message, 'NotFoundError: not found', 'not found')
40+
equal(error.status, 404, 'not found')
4141
}])
4242
})
4343
})

0 commit comments

Comments
 (0)