Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Apr 22, 2025

Using a virtual module for the Karma-based unit testing setup allows for the Angular packages used within the TestBed initialization to resolve to the same dependencies used within the application and test code. This avoids the potential for multiple copies of @angular/core within the test output which can result in TestBed execution failure due to the module level variable usage within TestBed.

Using a virtual module for the Karma-based unit testing setup allows for
the Angular packages used within the TestBed initialization to resolve to
the same dependencies used within the application and test code. This avoids
the potential for multiple copies of `@angular/core` within the test output
which can result in TestBed execution failure due to the module level variable
usage within TestBed.
@clydin clydin added the target: patch This PR is targeted for the next patch release label Apr 22, 2025
@clydin clydin requested a review from alan-agius4 April 22, 2025 15:51
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Apr 22, 2025
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: merge The PR is ready for merge by the caretaker labels Apr 23, 2025
@ngbot
Copy link

ngbot bot commented Apr 23, 2025

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "mergeability" is failing
If you want your PR to be merged, it has to pass all the CI checks.
If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Apr 23, 2025

Note: I tried this and this will not solve the tests when run with --preserve-symlinks=true, however I am going to merge this as it's a cleaner approach.

Actually I was wrong, it does fix the problem

@alan-agius4 alan-agius4 added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Apr 23, 2025
@alan-agius4 alan-agius4 merged commit 566de64 into angular:main Apr 23, 2025
36 of 37 checks passed
@clydin clydin deleted the karma/virtual-test-bed-init branch April 23, 2025 10:55
@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 May 24, 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: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants