Skip to content

Conversation

@bnjm
Copy link
Contributor

@bnjm bnjm commented Aug 14, 2024

Description

This adds vi.advanceTimersToNextFrame, using sinonjs/fake-timer's clock.runToFrame() method, which Jest exposed as jest.advanceTimersToNextFrame() in this PR. Credit to @alexreardon for the feature implementation and tests there. I copied the test over exactly, as that seems to be the convention for other tests in the timers test suite.

Resolves #6346

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify
Copy link

netlify bot commented Aug 14, 2024

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 5bbac39
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/66bdbe8c36767c000844b6e1
😎 Deploy Preview https://deploy-preview-6347--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@alexreardon
Copy link

Very cool! Thank you for the shoutout ❤️

sheremet-va
sheremet-va previously approved these changes Aug 15, 2024
@sheremet-va sheremet-va merged commit 8ff6356 into vitest-dev:main Aug 15, 2024
@sheremet-va
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for advancing timers to the next animation frame

3 participants