Skip to content

Commit 1aef29c

Browse files
JeanMechedylhunn
authored andcommitted
refactor(core): Cleanup for Iterable differs test. (angular#49598)
Remove some `any` and use the non-deprecated `Injector.create` overload. PR Close angular#49598
1 parent 061f3d1 commit 1aef29c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/core/test/change_detection/differs/iterable_differs_spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import {TestBed} from '@angular/core/testing';
1111

1212
{
1313
describe('IterableDiffers', function() {
14-
let factory1: any;
15-
let factory2: any;
16-
let factory3: any;
14+
let factory1: jasmine.SpyObj<IterableDifferFactory>;
15+
let factory2: jasmine.SpyObj<IterableDifferFactory>;
16+
let factory3: jasmine.SpyObj<IterableDifferFactory>;
1717

1818
beforeEach(() => {
1919
const getFactory = () => jasmine.createSpyObj('IterableDifferFactory', ['supports']);
@@ -33,26 +33,26 @@ import {TestBed} from '@angular/core/testing';
3333
factory2.supports.and.returnValue(true);
3434
factory3.supports.and.returnValue(true);
3535

36-
const differs = IterableDiffers.create(<any>[factory1, factory2, factory3]);
36+
const differs = IterableDiffers.create([factory1, factory2, factory3]);
3737
expect(differs.find('some object')).toBe(factory2);
3838
});
3939

4040
it('should copy over differs from the parent repo', () => {
4141
factory1.supports.and.returnValue(true);
4242
factory2.supports.and.returnValue(false);
4343

44-
const parent = IterableDiffers.create(<any>[factory1]);
45-
const child = IterableDiffers.create(<any>[factory2], parent);
44+
const parent = IterableDiffers.create([factory1]);
45+
const child = IterableDiffers.create([factory2], parent);
4646

4747
// @ts-expect-error private member
4848
expect(child.factories).toEqual([factory2, factory1]);
4949
});
5050

5151
describe('.extend()', () => {
5252
it('should extend di-inherited differs', () => {
53-
const parent = new IterableDiffers([factory1]);
53+
const differ = new IterableDiffers([factory1]);
5454
const injector =
55-
Injector.create({providers: [{provide: IterableDiffers, useValue: parent}]});
55+
Injector.create({providers: [{provide: IterableDiffers, useValue: differ}]});
5656
const childInjector =
5757
Injector.create({providers: [IterableDiffers.extend([factory2])], parent: injector});
5858

0 commit comments

Comments
 (0)