Skip to content

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Apr 28, 2025

Ensure proper cleanup of the Angular testing module when running tests with Vitest.

Closes: #30186


Blocked on angular/angular#61017 being released on NPM

@alan-agius4 alan-agius4 added state: blocked target: major This PR is targeted for the next major release labels Apr 28, 2025
alan-agius4 added a commit to alan-agius4/angular that referenced this pull request Apr 28, 2025
Expose `getCleanupHook` as a private export to address integration issues with Vitest. In Vitest, `globalThis.beforeEach` and `globalThis.afterEach` are not available by default. Additionally, these hooks are patched during module evaluation, complicating seamless integration with Vitest.

See: angular/angular-cli#30188
@alan-agius4 alan-agius4 requested a review from clydin April 28, 2025 10:11
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 28, 2025
mmalerba pushed a commit to angular/angular that referenced this pull request Apr 29, 2025
Expose `getCleanupHook` as a private export to address integration issues with Vitest. In Vitest, `globalThis.beforeEach` and `globalThis.afterEach` are not available by default. Additionally, these hooks are patched during module evaluation, complicating seamless integration with Vitest.

See: angular/angular-cli#30188

PR Close #61017
@clydin clydin added this to the v20 Candidates milestone Apr 30, 2025
@clydin clydin added target: rc This PR is targeted for the next release-candidate and removed target: major This PR is targeted for the next major release labels Apr 30, 2025
Ensure proper cleanup of the Angular testing module when running tests with Vitest.

Closes: angular#30186
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 2, 2025
@alan-agius4 alan-agius4 merged commit 8e0b14f into angular:main May 2, 2025
30 of 31 checks passed
@alan-agius4 alan-agius4 deleted the vitest-cleanup branch May 2, 2025 11:10
@alan-agius4
Copy link
Collaborator Author

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

@angular-automatic-lock-bot
Copy link

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 Jun 2, 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: @angular/build target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vitest: error when a file contains several tests

2 participants