Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Make delay and waitForIt test limit more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
priojeetpriyom committed Oct 6, 2023
1 parent b2778ca commit 175b360
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion services/blockchain-connector/tests/unit/delay.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ describe('Test delay method', () => {
await delay(delayMs);
const endTime = Date.now();
const millisDifference = endTime - startTime;
expect(millisDifference).toBeGreaterThanOrEqual(delayMs * 0.98);
expect(millisDifference).toBeGreaterThanOrEqual(delayMs - 1);
});
});
2 changes: 1 addition & 1 deletion services/blockchain-connector/tests/unit/waitForIt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Test waitForIt method', () => {
await waitForIt(testFn);
const endTime = Date.now();
const millisDifference = endTime - startTime;
expect(millisDifference).toBeGreaterThanOrEqual(delayMs * 0.98);
expect(millisDifference).toBeGreaterThanOrEqual(delayMs - 1);
});

it('should wait for the mocked function to return response', async () => {
Expand Down
2 changes: 1 addition & 1 deletion services/gateway/tests/unit/shared/waitForIt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Test waitForIt method', () => {
await waitForIt(testFn);
const endTime = Date.now();
const millisDifference = endTime - startTime;
expect(millisDifference).toBeGreaterThanOrEqual(delayMs * 0.98);
expect(millisDifference).toBeGreaterThanOrEqual(delayMs - 1);
});

it('should wait for the mocked function to return response', async () => {
Expand Down

0 comments on commit 175b360

Please sign in to comment.