
committed by
Miško Hevery

parent
00c110b055
commit
809e8f742e
@ -217,7 +217,7 @@ function factoryFn(a: any){}
|
||||
const injector = Injector.create([CarWithOptionalEngine.PROVIDER]);
|
||||
|
||||
const car = injector.get<CarWithOptionalEngine>(CarWithOptionalEngine);
|
||||
expect(car.engine).toEqual(null);
|
||||
expect(car.engine).toBeNull();
|
||||
});
|
||||
|
||||
it('should flatten passed-in providers', () => {
|
||||
@ -288,8 +288,8 @@ function factoryFn(a: any){}
|
||||
Injector.create([CarWithDashboard.PROVIDER, Engine.PROVIDER, Dashboard.PROVIDER]);
|
||||
expect(() => injector.get(CarWithDashboard))
|
||||
.toThrowError(
|
||||
`StaticInjectorError[${stringify(CarWithDashboard)} -> ${stringify(Dashboard)} -> DashboardSoftware]:
|
||||
NullInjectorError: No provider for DashboardSoftware!`);
|
||||
`StaticInjectorError[${stringify(CarWithDashboard)} -> ${stringify(Dashboard)} -> DashboardSoftware]: \n` +
|
||||
' NullInjectorError: No provider for DashboardSoftware!');
|
||||
});
|
||||
|
||||
it('should throw when trying to instantiate a cyclic dependency', () => {
|
||||
@ -415,8 +415,9 @@ function factoryFn(a: any){}
|
||||
parent);
|
||||
|
||||
expect(() => child.get(Car))
|
||||
.toThrowError(`StaticInjectorError[${stringify(Car)} -> ${stringify(Engine)}]:
|
||||
NullInjectorError: No provider for Engine!`);
|
||||
.toThrowError(
|
||||
`StaticInjectorError[${stringify(Car)} -> ${stringify(Engine)}]: \n` +
|
||||
' NullInjectorError: No provider for Engine!');
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user