Skip to content

Commit

Permalink
fix: more tolerant performance.measure unit tests (#6726)
Browse files Browse the repository at this point in the history
Fixes #6725
  • Loading branch information
kitsonk authored Jul 13, 2020
1 parent 3be2064 commit dd59bf5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/tests/unit/performance_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ unitTest(function performanceMeasure() {
assertEquals(measure.entryType, "measure");
assert(measure.startTime > 0);
assertEquals(mark.startTime, measure.startTime);
assert(measure.duration >= 100 && measure.duration < 200);
assert(
measure.duration >= 100,
`duration below 100ms: ${measure.duration}`
);
assert(
measure.duration < 500,
`duration exceeds 500ms: ${measure.duration}`
);
const entries = performance.getEntries();
assert(entries[entries.length - 1] === measure);
const measureEntries = performance.getEntriesByName("test", "measure");
Expand Down

0 comments on commit dd59bf5

Please sign in to comment.