Skip to content

Commit 8381059

Browse files
authored
fix test
1 parent 14148c8 commit 8381059

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

test/each.test.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,16 @@ describe('each', function() {
1111
var total = 100000;
1212
var retrieved = 0;
1313

14-
// assert fails sometimes if previous test is still running & blocking.
15-
// so wait until it is finished.
16-
db.wait(function() {
17-
db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) {
18-
if (err) throw err;
19-
retrieved++;
20-
});
2114

22-
db.wait(function() {
15+
db.each('SELECT id, txt FROM foo LIMIT 0, ?', total, function(err, row) {
16+
if (err) throw err;
17+
retrieved++;
18+
19+
if(retrieved === total) {
2320
assert.equal(retrieved, total, "Only retrieved " + retrieved + " out of " + total + " rows.");
2421
done();
25-
});
22+
}
2623
});
27-
2824
});
2925

3026
it('Statement#each with complete callback', function(done) {

0 commit comments

Comments
 (0)