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
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