Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
test(minDuraton): fix tests if they are execute really fast
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiocro committed Oct 2, 2017
1 parent 8d583c9 commit 1374daf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/unit/min-duration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('minDuration', () => {
const start = new Date().getTime();
const call = minDuration({ minTime: 100 })(v => Promise.resolve(v));
return call().then((d) => {
expect(new Date().getTime() - start).to.be.above(100);
expect(new Date().getTime() - start).to.be.above(99);
return d;
});
});
Expand All @@ -14,7 +14,7 @@ describe('minDuration', () => {
const start = new Date().getTime();
const call = minDuration({ minTime: 100 })(v => Promise.reject(v));
return call().catch((d) => {
expect(new Date().getTime() - start).to.be.above(100);
expect(new Date().getTime() - start).to.be.above(99);
return d;
});
});
Expand All @@ -23,7 +23,7 @@ describe('minDuration', () => {
const start = new Date().getTime();
const call = minDuration({ minTime: 100 })(delayedPromiseCall());
return call(150).catch((d) => {
expect(new Date().getTime() - start).to.be.above(150);
expect(new Date().getTime() - start).to.be.above(149);
return d;
});
});
Expand All @@ -33,7 +33,7 @@ describe('minDuration', () => {
const start = new Date().getTime();
const call = minDuration({ minTime: 100 })(delayedPromiseCall());
return call(150).then((d) => {
expect(new Date().getTime() - start).to.be.above(150);
expect(new Date().getTime() - start).to.be.above(149);
return d;
});
});
Expand Down

0 comments on commit 1374daf

Please sign in to comment.