Skip to content

Commit

Permalink
Revise test delay tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip Gates-Idem committed Feb 13, 2018
1 parent 95eb775 commit 9c7834c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test('should default to 3 attempts with 200 delay', async (t) => {
let diff = newTime - lastTime;
lastTime = newTime;

t.true(diff <= (expectedDelays[context.attemptNum] + DELAY_TOLERANCE));
t.true(almostEqual(diff, expectedDelays[context.attemptNum], DELAY_TOLERANCE));

throw new Error(`attempt ${context.attemptNum}`);
}));
Expand All @@ -65,7 +65,7 @@ test('should support initialDelay', async (t) => {
let diff = newTime - lastTime;
lastTime = newTime;

t.true(diff <= (expectedDelays[context.attemptNum] + DELAY_TOLERANCE));
t.true(almostEqual(diff, expectedDelays[context.attemptNum], DELAY_TOLERANCE));

throw new Error(`attempt ${context.attemptNum}`);
}, {
Expand Down

0 comments on commit 9c7834c

Please sign in to comment.