Skip to content

Commit 4792726

Browse files
committed
Fix an error in test_database where it was calling done twice
1 parent fe22c2d commit 4792726

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/test_database.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ exports.test = function(sql, assert, done) {
5050
}, function last () {
5151
finished = true;
5252
assert.strictEqual(count, 2, "db.each returns the right number of rows");
53+
// No need to wait for this timeout anymore
54+
// In fact, if we do keep waiting for this, we'll get an error when it fires because we've already called done
55+
clearTimeout(testTimeoutId);
5356
done();
5457
});
55-
var timeout = setTimeout(function timeout(){
58+
var testTimeoutId = setTimeout(function timeout(){
5659
assert.strictEqual(finished, true,
5760
"db.each should call its last callback after having returned the rows");
5861
done();

0 commit comments

Comments
 (0)