Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

abstract-leveldown

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstract-leveldown - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

38

abstract/iterator-test.js

@@ -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" : [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc