refactor(core): Migrate TestBed.get to TestBed.inject (#32382)
This is cleanup/followup for PR #32200 PR Close #32382
This commit is contained in:

committed by
Matias Niemelä

parent
a64eded521
commit
9166baf709
@ -170,8 +170,8 @@ withEachNg1Version(() => {
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
compiler = TestBed.get(Compiler);
|
||||
registry = TestBed.get(TestabilityRegistry);
|
||||
compiler = TestBed.inject(Compiler);
|
||||
registry = TestBed.inject(TestabilityRegistry);
|
||||
adapter = getAdaptor();
|
||||
});
|
||||
beforeEach(() => registry.unregisterAllApplications());
|
||||
@ -179,7 +179,7 @@ withEachNg1Version(() => {
|
||||
|
||||
it('should add testabilities hook when creating components', () => {
|
||||
|
||||
let registry = TestBed.get(TestabilityRegistry);
|
||||
let registry = TestBed.inject(TestabilityRegistry);
|
||||
adapter.createComponent([]);
|
||||
expect(registry.getAllTestabilities().length).toEqual(1);
|
||||
|
||||
@ -189,7 +189,7 @@ withEachNg1Version(() => {
|
||||
});
|
||||
|
||||
it('should remove the testability hook when destroy a component', () => {
|
||||
const registry = TestBed.get(TestabilityRegistry);
|
||||
const registry = TestBed.inject(TestabilityRegistry);
|
||||
expect(registry.getAllTestabilities().length).toEqual(0);
|
||||
adapter.createComponent([]);
|
||||
expect(registry.getAllTestabilities().length).toEqual(1);
|
||||
|
Reference in New Issue
Block a user