feat(core): Introduce TestBed.inject to replace TestBed.get (#32200)
TestBed.get is not type safe, fixing it would be a massive breaking change. The Angular team has proposed replacing it with TestBed.inject and deprecate TestBed.get. Deprecation from TestBed.get will come as a separate commit. Issue #26491 Fixes #29905 BREAKING CHANGE: Injector.get now accepts abstract classes to return type-safe values. Previous implementation returned `any` through the deprecated implementation. PR Close #32200
This commit is contained in:

committed by
Misko Hevery

parent
2b28b91fd9
commit
3aba7ebe6a
@ -677,7 +677,7 @@ describe('AppComponent', () => {
|
||||
});
|
||||
|
||||
it('should not be loaded/registered until necessary', () => {
|
||||
const loader: TestElementsLoader = fixture.debugElement.injector.get(ElementsLoader);
|
||||
const loader = fixture.debugElement.injector.get(ElementsLoader) as unknown as TestElementsLoader;
|
||||
expect(loader.loadCustomElement).not.toHaveBeenCalled();
|
||||
|
||||
setHasFloatingToc(true);
|
||||
|
Reference in New Issue
Block a user