abstract-leveldown
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -61,25 +61,23 @@ var db | ||
module.exports.sequence = function (test) { | ||
test('test twice iterator#end() throws', function (t) { | ||
test('test twice iterator#end() callback with error', function (t) { | ||
var iterator = db.iterator() | ||
iterator.end(function (err) { | ||
t.notOk(err, 'no error') | ||
t.throws( | ||
iterator.end.bind(iterator, function () {}) | ||
, { name: 'Error', message: 'end() already called on iterator' } | ||
, 'no-arg iterator#next() throws' | ||
) | ||
t.end() | ||
iterator.end(function(err2) { | ||
var expected = { name: 'Error', message: 'end() already called on iterator' } | ||
t.deepEqual(err2, expected, 'error expected in the callback') | ||
t.end() | ||
}) | ||
}) | ||
}) | ||
test('test iterator#next after iterator#end() throws', function (t) { | ||
test('test iterator#next after iterator#end() callback with error', function (t) { | ||
var iterator = db.iterator() | ||
iterator.end(function (err) { | ||
t.notOk(err, 'no error') | ||
t.throws( | ||
iterator.next.bind(iterator, function () {}) | ||
, { name: 'Error', message: 'cannot call next() after end()' } | ||
, 'no-arg iterator#next() after iterator#end() throws' | ||
) | ||
t.end() | ||
iterator.next(function(err2) { | ||
var expected = { name: 'Error', message: 'cannot call next() after end()' } | ||
t.deepEqual(err2, expected, 'error expected in the callback') | ||
t.end() | ||
}) | ||
}) | ||
@@ -97,7 +95,7 @@ }) | ||
}) | ||
t.throws( | ||
iterator.next.bind(iterator, function () {}) | ||
, { name: 'Error', message: 'cannot call next() before previous next() has completed' } | ||
, 'no-arg iterator#next() throws' | ||
) | ||
iterator.next(function(err) { | ||
var expected = { name: 'Error', message: 'cannot call next() before previous next() has completed' } | ||
t.deepEqual(err, expected, 'error expected in the callback') | ||
t.end() | ||
}) | ||
}) | ||
@@ -437,2 +435,2 @@ } | ||
module.exports.tearDown(test, testCommon) | ||
} | ||
} |
{ | ||
"name" : "abstract-leveldown" | ||
, "description" : "An abstract prototype matching the LevelDOWN API" | ||
, "version" : "0.4.0" | ||
, "version" : "0.5.0" | ||
, "homepage" : "https://github.com/rvagg/node-abstract-leveldown" | ||
@@ -16,2 +16,4 @@ , "contributors" : [ | ||
, "Paolo Fragomeni <paolo@async.ly> (https://github.com/hij1nx)" | ||
, "Anton Whalley <anton.whalley@nearform.com> (https://github.com/No9)" | ||
, "Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)" | ||
] | ||
@@ -18,0 +20,0 @@ , "authors" : [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82464
1793