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

refactor(core): private export token to disable fixture.detectChanges error #55098

Closed
wants to merge 1 commit into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Mar 28, 2024

While we do want to discourage fixture.detectChanges, it is yet to be determined how this should be accomplished (warning, documentation, etc.). At the moment, not being able to disable the error at all is entirely prohibitive for existing test suites to use zoneless change detection in tests. We would much rather allow existing test suites to disable the error and use the zoneless change detection than prevent them from using it entirely until all the detectChanges calls have been fixed. Calling detectChanges manually can hide errors related to change detection timing, but it is even worse when the "PseudoApplication" fixture used (since it runs change detection only on the component rather than through ApplicationRef).

…s` error

While we do want to discourage `fixture.detectChanges`, it is yet to be
determined how this should be accomplished (warning, documentation, etc.). At
the moment, not being able to disable the error at all is entirely
prohibitive for existing test suites to use zoneless change detection in
tests. We would much rather allow existing test suites to disable the
error and use the zoneless change detection than prevent them from using
it entirely until all the `detectChanges` calls have been fixed.
Calling `detectChanges` manually can hide errors related to change
detection timing, but it is even worse when the "PseudoApplication"
fixture used (since it runs change detection _only_ on the component
rather than through `ApplicationRef`).
@atscott atscott requested a review from alxhub March 28, 2024 18:08
@atscott atscott added the area: core Issues related to the framework runtime label Mar 28, 2024
@ngbot ngbot bot added this to the Backlog milestone Mar 28, 2024
@atscott atscott added the area: testing Issues related to Angular testing features, such as TestBed label Mar 28, 2024
@atscott atscott requested a review from mmalerba March 28, 2024 18:08
@atscott atscott added the target: minor This PR is targeted for the next minor release label Mar 28, 2024
@dylhunn dylhunn self-requested a review March 28, 2024 20:10
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Mar 28, 2024
@atscott
Copy link
Contributor Author

atscott commented Mar 28, 2024

This PR was merged into the repository by commit edfc5a9.

@atscott atscott closed this in edfc5a9 Mar 28, 2024
ilirbeqirii pushed a commit to ilirbeqirii/angular that referenced this pull request Apr 6, 2024
…s` error (angular#55098)

While we do want to discourage `fixture.detectChanges`, it is yet to be
determined how this should be accomplished (warning, documentation, etc.). At
the moment, not being able to disable the error at all is entirely
prohibitive for existing test suites to use zoneless change detection in
tests. We would much rather allow existing test suites to disable the
error and use the zoneless change detection than prevent them from using
it entirely until all the `detectChanges` calls have been fixed.
Calling `detectChanges` manually can hide errors related to change
detection timing, but it is even worse when the "PseudoApplication"
fixture used (since it runs change detection _only_ on the component
rather than through `ApplicationRef`).

PR Close angular#55098
@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 Apr 28, 2024
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: core Issues related to the framework runtime area: testing Issues related to Angular testing features, such as TestBed target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants