Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest Utils: add "act and wait run all timers async function" #403

Open
birdofpreyru opened this issue Nov 1, 2024 · 0 comments
Open

Jest Utils: add "act and wait run all timers async function" #403

birdofpreyru opened this issue Nov 1, 2024 · 0 comments
Labels
P2 Important. Nice to have improvements and optimizations.

Comments

@birdofpreyru
Copy link
Owner

working on a project with lots of testing it feels handy to have a helper that would substitute this

await act(() => {
  action();
  return jest.runAllTimersAsync();
});

to just

await actAndRunAllTimersAsync(action);
@birdofpreyru birdofpreyru added the P2 Important. Nice to have improvements and optimizations. label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Important. Nice to have improvements and optimizations.
Projects
None yet
Development

No branches or pull requests

1 participant