Skip to content

Commit

Permalink
Fix bug in test_database
Browse files Browse the repository at this point in the history
The function named "finished" hid the variable of the same name.
  • Loading branch information
lovasoa committed Nov 10, 2014
1 parent 9b09552 commit e9ba367
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/test_database.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ exports.test = function(sql, assert, done) {
count++;
if (count === 1) assert.deepEqual(row, {a:1,b:'a'}, 'db.each returns the correct 1st row');
if (count === 2) assert.deepEqual(row, {a:2,b:'b'}, 'db.each returns the correct 2nd row');
}, function finished () {
}, function last () {
finished = true;
assert.ok(count === 2, "db.each returns the right number of rows");
done();
assert.strictEqual(count, 2, "db.each returns the right number of rows");
});
var timeout = setTimeout(function timeout(){
assert.ok(finished === true, "db.each should call its last callback after having returned the rows");
assert.strictEqual(finished, true,
"db.each should call its last callback after having returned the rows");
done();
}, 3000);
};
Expand Down

0 comments on commit e9ba367

Please sign in to comment.