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

feat(core): Add TestBed.runInContext to help test functions which use inject #47955

Closed
wants to merge 1 commit into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Nov 3, 2022

This commit adds TestBed.runInContext which is equivalent to TestBed.inject(EnvironmentInjector).runInContext. This function will help make tests for functions which call inject from @angular/core a little bit less verbose.

@atscott atscott added the target: minor This PR is targeted for the next minor release label Nov 3, 2022
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Nov 3, 2022
@atscott atscott force-pushed the TestBedRunInContext branch 2 times, most recently from cd3cc27 to a13ec33 Compare November 3, 2022 18:15
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

@pullapprove pullapprove bot requested a review from dylhunn November 4, 2022 23:17
@atscott atscott added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Nov 7, 2022
@jessicajaniuk jessicajaniuk added the area: core Issues related to the framework runtime label Nov 9, 2022
@ngbot ngbot bot added this to the Backlog milestone Nov 9, 2022
…s which use `inject`

This commit adds `TestBed.runInInjectionContext` which is equivalent to
`TestBed.inject(EnvironmentInjector).runInContext`. This function will
help make tests for functions which call `inject` from `@angular/core` a
little bit less verbose.
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

Copy link
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: public-api

@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Nov 21, 2022
@dylhunn
Copy link
Contributor

dylhunn commented Nov 22, 2022

@atscott Looks like this has a presubmit issue

@dylhunn dylhunn added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker labels Nov 22, 2022
@atscott atscott removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Nov 22, 2022
@atscott
Copy link
Contributor Author

atscott commented Nov 22, 2022

Caretaker Note: Please ignore the google-internal-tests status. Failing tests are pre-existing and unrelated. Deflaking has no affect because the tests are fully failing at head, not flaky.

@atscott atscott added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note action: merge The PR is ready for merge by the caretaker labels Nov 22, 2022
@dylhunn
Copy link
Contributor

dylhunn commented Nov 23, 2022

This PR was merged into the repository by commit 6acae14.

@dylhunn dylhunn closed this in 6acae14 Nov 23, 2022
@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 Dec 24, 2022
trekladyone pushed a commit to trekladyone/angular that referenced this pull request Feb 1, 2023
…s which use `inject` (angular#47955)

This commit adds `TestBed.runInInjectionContext` which is equivalent to
`TestBed.inject(EnvironmentInjector).runInContext`. This function will
help make tests for functions which call `inject` from `@angular/core` a
little bit less verbose.

PR Close angular#47955
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 detected: feature PR contains a feature commit merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note 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

5 participants