Skip to content

Commit

Permalink
Add code comment to tests
Browse files Browse the repository at this point in the history
Fixes #41
  • Loading branch information
sindresorhus committed Jul 8, 2021
1 parent c9c0882 commit a6666d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test.js
Expand Up @@ -43,6 +43,8 @@ const mapper = async ([value, ms]) => {
test('main', async t => {
const end = timeSpan();
t.deepEqual(await pMap(sharedInput, mapper), [10, 20, 30]);

// We give it some leeway on both sides of the expected 300ms as the exact value depends on the machine and workload.
t.true(inRange(end(), {start: 290, end: 430}));
});

Expand Down

0 comments on commit a6666d1

Please sign in to comment.