Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(core): remove TestBed.get #60414

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

Closed
wants to merge 2 commits into from

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Mar 17, 2025

TestBed.get isn't type safe and has been deprecated for several years now. These changes remove it from the public API.

BREAKING CHANGE:

  • TestBed.get has been removed. Use TestBed.inject instead.

@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release labels Mar 17, 2025
@angular-robot angular-robot bot added detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit area: core Issues related to the framework runtime area: migrations Issues related to `ng update` migrations labels Mar 17, 2025
@ngbot ngbot bot added this to the Backlog milestone Mar 17, 2025
@crisbeto crisbeto force-pushed the test-bed-get-removal branch from 2b0888a to db7c556 Compare March 17, 2025 09:14
`TestBed.get` isn't type safe and has been deprecated for several years now. These changes remove it from the public API and a follow-up change will add an automated migration to `TestBed.inject`.

BREAKING CHANGE:
* `TestBed.get` has been removed. Use `TestBed.inject` instead.
Adds a migration that will move users off the deprecated `TestBed.get` method.
@crisbeto crisbeto force-pushed the test-bed-get-removal branch from db7c556 to 2abad2f Compare March 17, 2025 09:16
@crisbeto crisbeto requested a review from devversion March 17, 2025 09:38
@crisbeto crisbeto marked this pull request as ready for review March 17, 2025 09:38
Copy link
Member

@pkozlowski-opensource pkozlowski-opensource left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewed-for: fw-general
Reviewed-for: fw-security

Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewed-for: public-api

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewed-for: fw-security

@pullapprove pullapprove bot requested review from AndrewKushnir and kirjs March 17, 2025 14:55
@crisbeto crisbeto added the action: global presubmit The PR is in need of a google3 global presubmit label Mar 17, 2025
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewed-for: fw-security

);

await runMigration();
expect(tree.readContent('/test.ts')).toContain(
Copy link
Contributor

Choose a reason for hiding this comment

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

Super nit, but maybe expect it not to contain TestBed.get?

@pullapprove pullapprove bot requested a review from atscott March 17, 2025 21:05
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

@crisbeto
Copy link
Member Author

Passing TGP, once a handful of clients are cleaned up.

@crisbeto crisbeto removed the action: global presubmit The PR is in need of a google3 global presubmit label Mar 18, 2025
@crisbeto crisbeto added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Mar 18, 2025
@crisbeto crisbeto removed request for atscott and alxhub March 18, 2025 08:03
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: merge The PR is ready for merge by the caretaker labels Mar 18, 2025
@pkozlowski-opensource
Copy link
Member

This PR was merged into the repository by commit 34f0453.

The changes were merged into the following branches: main

pkozlowski-opensource pushed a commit that referenced this pull request Mar 19, 2025
Adds a migration that will move users off the deprecated `TestBed.get` method.

PR Close #60414
@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 19, 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: core Issues related to the framework runtime area: migrations Issues related to `ng update` migrations detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants