Skip to content

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

Closed
atscott wants to merge 1 commit into
angular:mainfrom
atscott:TestBedRunInContext
Closed

feat(core): Add TestBed.runInContext to help test functions which use inject#47955
atscott wants to merge 1 commit into
angular:mainfrom
atscott:TestBedRunInContext

Conversation

@atscott

@atscott atscott commented Nov 3, 2022

Copy link
Copy Markdown
Contributor

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

@AndrewKushnir AndrewKushnir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@pullapprove pullapprove Bot requested a review from AndrewKushnir November 4, 2022 23:16

@AndrewKushnir AndrewKushnir left a comment

Copy link
Copy Markdown
Contributor

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
Comment thread goldens/public-api/core/testing/index.md Outdated
@pullapprove pullapprove Bot requested a review from jessicajaniuk November 14, 2022 10:52
@atscott atscott force-pushed the TestBedRunInContext branch from 5760999 to 49324e4 Compare November 17, 2022 18:41
…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.
@atscott atscott force-pushed the TestBedRunInContext branch from 49324e4 to 3f45e2d Compare November 17, 2022 18:41

@AndrewKushnir AndrewKushnir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed-for: public-api

@dylhunn dylhunn left a comment

Copy link
Copy Markdown
Contributor

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

dylhunn commented Nov 22, 2022

Copy link
Copy Markdown
Contributor

@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

atscott commented Nov 22, 2022

Copy link
Copy Markdown
Contributor Author

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

dylhunn commented Nov 23, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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.

5 participants