-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
p1-choreDoesn't change code behavior (priority)Doesn't change code behavior (priority)
Description
Describe the bug
Hi 👋
I'm not sure if this a bug or not, but I noticed that Vitest fake timers don't work with High precision timing Web API, specifically for performance.now().
Is it possible to support it?
Reproduction
Code snippet:
Stdout example:
> npm run test -- fakeTimers.test.ts
stdout | fakeTimers.test.ts > fake timers > works for performance.now?
(before) performance.now() [1] | 1802.5662189722061
(before) performance.now() [2] | 1803.9706729650497
(before) performance.now() [3] | 1804.0636450052261
(after) performance.now() [1] | 1804.601235985756
(after) performance.now() [2] | 1804.7059119939804
(after) performance.now() [3] | 1804.8976829051971
System Info
System:
OS: macOS 13.4.1
CPU: (8) x64 Intel(R) Core(TM) i7-8557U CPU @ 1.70GHz
Memory: 151.96 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node
npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm
Browsers:
Chrome: 116.0.5845.96
Chrome Canary: 118.0.5963.0
Safari: 16.5.2
npmPackages:
vitest: 0.34.1 => 0.34.1Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p1-choreDoesn't change code behavior (priority)Doesn't change code behavior (priority)
Type
Projects
Status
Approved