Skip to content

fix(@angular/build): perform testing module cleanup when using Vitest#30188

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

Open
wants to merge 1 commit into
base:main
Choose a base branch
from

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4alan-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-agius4alan-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
Ensure proper cleanup of the Angular testing module when running tests with Vitest. Closes: angular#30186
@alan-agius4alan-agius4 requested a review from clydinApril 28, 2025 10:11
@alan-agius4alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 28, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: reviewThe PR is still awaiting reviews from at least one requested reviewerarea: @angular/buildstate: blockedtarget: majorThis PR is targeted for the next major release
1 participant
@alan-agius4
close