You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Other libraries you are using: Playwright (but should be irrelevant)
What did you expect to happen?
Faking timers with default settings (which will fake performance) should fake all of the performance methods including performance.mark, performance.measure, etc.
What actually happens
These methods exist and can be called, but seem to do nothing since calling performance.measure() returns undefined which isn't a valid return value and then the code crashes when trying to access the properties which are expected to exist on the result.
How to reproduce
const FakeTimers = await import("https://esm.sh/@sinonjs/fake-timers@11.2.2");
FakeTimers.install();
performance.mark("start");
performance.mark("end");
const measurement = performance.measure("duration", "start", "end");
console.log("duration is", measurement.duration); // Crashes here since measurement is undefined
The text was updated successfully, but these errors were encountered:
CreativeTechGuy
changed the title
Support performance.* methods
Support performance.measure method
Mar 13, 2024
What did you expect to happen?
Faking timers with default settings (which will fake
performance
) should fake all of the performance methods includingperformance.mark
,performance.measure
, etc.What actually happens
These methods exist and can be called, but seem to do nothing since calling
performance.measure()
returnsundefined
which isn't a valid return value and then the code crashes when trying to access the properties which are expected to exist on the result.How to reproduce
The text was updated successfully, but these errors were encountered: