fix(di): improve error messages for invalid bindings
Fixes #1515 Closes #1573
This commit is contained in:
committed by
Misko Hevery
parent
c0f3778dda
commit
ee1b574baf
+5
-2
@@ -205,8 +205,11 @@ export function main() {
|
||||
});
|
||||
|
||||
it('should throw when given invalid bindings', function () {
|
||||
expect(() => Injector.resolveAndCreate(["blah"])).toThrowError('Invalid binding blah');
|
||||
expect(() => Injector.resolveAndCreate([bind("blah")])).toThrowError('Invalid binding blah');
|
||||
expect(() => Injector.resolveAndCreate(["blah"]))
|
||||
.toThrowError('Invalid binding - only instances of Binding and Type are allowed, got: blah');
|
||||
expect(() => Injector.resolveAndCreate([bind("blah")]))
|
||||
.toThrowError('Invalid binding - only instances of Binding and Type are allowed, ' +
|
||||
'got: BindingBuilder with blah token');
|
||||
});
|
||||
|
||||
it('should provide itself', function () {
|
||||
|
||||
Reference in New Issue
Block a user