Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Clarify expected behavior in iterator-test
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Apr 26, 2019
1 parent 3f882dd commit 31b66cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/iterator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ make('close db with open iterator', function (db, t, done) {

ite.next(function loop (err, key, value) {
if (cnt++ === 0) {
// The first call should succeed, because it was scheduled before close()
t.ifError(err, 'no error from next()')
} else {
// The second call should fail, because it was scheduled after close()
t.equal(err.message, 'iterator has ended')
hadError = true
}
Expand Down

0 comments on commit 31b66cf

Please sign in to comment.