fix(core): report errors for missing di tokens correctly (#11209)

This commit is contained in:
Tobias Bosch
2016-08-31 14:47:56 -07:00
committed by Martin Probst
parent 6ea5b05e7c
commit cc89ef6c8c
3 changed files with 1 additions and 37 deletions

View File

@ -336,25 +336,6 @@ export function main() {
}
});
it('should provide context when throwing an exception ', () => {
var engineProvider =
ReflectiveInjector.resolve([{provide: Engine, useClass: BrokenEngine}])[0];
var protoParent = new ReflectiveProtoInjector([engineProvider]);
var carProvider = ReflectiveInjector.resolve([Car])[0];
var protoChild = new ReflectiveProtoInjector([carProvider]);
var parent = new ReflectiveInjector_(protoParent, null, () => 'parentContext');
var child = new ReflectiveInjector_(protoChild, parent, () => 'childContext');
try {
child.get(Car);
throw 'Must throw';
} catch (e) {
expect(e.context).toEqual('childContext');
}
});
it('should instantiate an object after a failed attempt', () => {
var isBroken = true;