feat(core): align fake timers api#1439
Conversation
Deploying rstest with
|
| Latest commit: |
cf0c937
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1764f853.rstest.pages.dev |
| Branch Preview URL: | https://9aoy-fake-timers-api.rstest.pages.dev |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf0c937f48
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f45d989ba3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
This PR aligns Rstest's fake timers runtime API with the upgraded
@sinonjs/fake-timers@15.4.0API surface. The runtime now accepts the upstream tick/system-time input types, addsrstest.jumpTimersByTime()andrstest.setTickMode(), and updates the public types plus English/Chinese docs accordingly.It also fixes the browser-mode compatibility gap: browser mode previously aliased
@sinonjs/fake-timersto a local no-op/minimal stub that only kept a clock-shaped object and did not actually fake browser globals such assetTimeoutorDate. Since modern@sinonjs/fake-timersprovides browser bundler fallbacks and the core browser runtime bundles the real implementation, this PR removes the alias and stub so browser tests use real fake timers. A browser e2e file now validates the full fake-timer flow, including timer globals, Date/performance, async timers, animation frames, microtasks, excluded timers, string durations,jumpTimersByTime, andsetTickMode.Related Links
https://github.com/sinonjs/fake-timers/releases/tag/v15.4.0
Checklist