Skip to content

Commit

Permalink
Ensure consistent test results
Browse files Browse the repository at this point in the history
  • Loading branch information
xdmnl committed Jul 5, 2018
1 parent b6a6dae commit a53a465
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,18 @@ var Limiter = require('..'),
});

it('should return an increasing reset time after each call', function (done) {
var originalResetMs;
limit.get(function(err, res) {
originalResetMs = res.resetMs;
setTimeout(function () {
limit.get(function(err, res) {
var originalResetMs = res.resetMs;

setTimeout(function() {
limit.get(function (err, res) {
res.resetMs.should.be.greaterThan(originalResetMs);
done();
});
}, 200);
});
setTimeout(function() {
limit.get(function (err, res) {
res.resetMs.should.be.greaterThan(originalResetMs);
done();
});
}, 10);
});
}, 10);
});
});

Expand Down

0 comments on commit a53a465

Please sign in to comment.