Skip to content

fix(zone.js): waitForAsync should pass args to the test function#61755

Closed
atscott wants to merge 1 commit intoangular:mainfrom
atscott:waitforasyncjest
Closed

fix(zone.js): waitForAsync should pass args to the test function#61755
atscott wants to merge 1 commit intoangular:mainfrom
atscott:waitforasyncjest

Conversation

@atscott
Copy link
Copy Markdown
Contributor

@atscott atscott commented May 29, 2025

This ensures that test functions with arguments (e.g. it.each in jest) are forwarded to the test function. This does not apply to jasmine, which assumes the only arguments needed would be the done function.

fixes #61717

@atscott atscott added the target: patch This PR is targeted for the next patch release label May 29, 2025
@pullapprove pullapprove bot requested review from JiaLiPassion May 29, 2025 20:00
@angular-robot angular-robot bot added the area: zones Issues related to zone.js label May 29, 2025
@ngbot ngbot bot added this to the Backlog milestone May 29, 2025
@NateRadebaugh
Copy link
Copy Markdown
Contributor

Should this also have a matching test for vitest?

@atscott
Copy link
Copy Markdown
Contributor Author

atscott commented May 30, 2025

@NateRadebaugh No, fakeAsync and waitForAsync are not supported in Vitest right now.

Edit: Added a test for vitest. We do have some private APIs for supporting it without the patches that are in place for jasmine, jest, and mocha while we consider what the plan is for Vitest.

@atscott atscott requested a review from clydin June 6, 2025 22:37
This ensures that test functions with arguments (e.g. `it.each` in jest)
are forwarded to the test function. This does not apply to jasmine,
which assumes the only arguments needed would be the `done` function.

fixes angular#61717
@atscott atscott force-pushed the waitforasyncjest branch from 5aec37b to 4a5cd99 Compare June 6, 2025 22:43
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Jun 9, 2025
@AndrewKushnir
Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit 3c216c1.

The changes were merged into the following branches: main, 20.0.x

AndrewKushnir pushed a commit that referenced this pull request Jun 9, 2025
)

This ensures that test functions with arguments (e.g. `it.each` in jest)
are forwarded to the test function. This does not apply to jasmine,
which assumes the only arguments needed would be the `done` function.

fixes #61717

PR Close #61755
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: zones Issues related to zone.js target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test wrapped in waitForAsync does not receive parameterized values from jest it.each

4 participants