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.typedGet #30036

Closed
wants to merge 1 commit into from
Closed

feat(core): Add TestBed.typedGet #30036

wants to merge 1 commit into from

Conversation

Goodwine
Copy link

@Goodwine Goodwine commented Apr 22, 2019

TestBed.typedGet is a non breaking change to make way for a typed
TestBed.get signature. This commit adds the function with a different
name and strong types.

A future commit for Angular 9.x will replace the current TestBed.get
signature with the one added here, and TestBed.typedGet will be then
marked as deprecated to be completly removed on Angular 10.x

Injector.get will match the same signature as TestBed.typedGet on
Angular 9.x, both being breaking changes added at the same time.

Issue #26491
Fixes #29905

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

TestBed.get returns any

Issue Number: #26491

What is the new behavior?

TestBed.typedGet<T> returns T

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This is pre-work for a future breaking change where TestBed.get will no longer return any

@Goodwine Goodwine requested a review from a team as a code owner April 22, 2019 21:52
@Goodwine Goodwine requested a review from a team as a code owner April 22, 2019 21:58
`TestBed.typedGet` is a non breaking change to make way for a typed
`TestBed.get` signature. This commit adds the function with a different
name and strong types.

A future commit for Angular 9.x will replace the current `TestBed.get`
signature with the one added here, and `TestBed.typedGet` will be then
marked as deprecated to be completly removed on Angular 10.x

`Injector.get` will match the same signature as `TestBed.typedGet` on
Angular 9.x, both being breaking changes added at the same time.

Issue #26491
Fixes #29905
@benlesh benlesh added the area: core Issues related to the framework runtime label Apr 22, 2019
@ngbot ngbot bot added this to the needsTriage milestone Apr 22, 2019
@Goodwine Goodwine mentioned this pull request Apr 23, 2019
14 tasks
@Goodwine
Copy link
Author

After discussing with Vikram, I'm closing this for #32200

@Goodwine Goodwine closed this Aug 21, 2019
@Goodwine Goodwine deleted the stronger-typed-testbed-get branch August 21, 2019 18:23
@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 Sep 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New TestBed.get shows deprecation warning for abstract types and everywhere if using a strict tsconfig
3 participants