Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 13, 2022
1 parent 65fc4a4 commit ddfeb8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ test('invalid version does not cause catatrophic backtracking', t => {
const fixture = `0.0.0-0${'.-------'.repeat(index)}@`;
semverRegex().test(fixture);
const difference = Date.now() - start;
t.true(difference < 10, `Execution time: ${difference}`);
t.true(difference < 20, `Execution time: ${difference}`);
}

for (let index = 1; index <= 20; index++) {
const start = Date.now();
const fixture = `0.0.1-${'-.--'.repeat(index)} `;
semverRegex().test(fixture);
const difference = Date.now() - start;
t.true(difference < 10, `Execution time: ${difference}`);
t.true(difference < 20, `Execution time: ${difference}`);
}
});

0 comments on commit ddfeb8b

Please sign in to comment.