1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00

fix: more tolerant performance.measure unit tests (#6726)

Fixes #6725
This commit is contained in:
Kitson Kelly 2020-07-13 14:50:57 +10:00 committed by GitHub
parent 3be2064803
commit dd59bf5fc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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");