diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/auto/injectorSpec.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/auto/injectorSpec.js b/test/auto/injectorSpec.js index dcf01d3c..a70cd763 100644 --- a/test/auto/injectorSpec.js +++ b/test/auto/injectorSpec.js @@ -74,6 +74,17 @@ describe('injector', function() { }); + it('should not corrupt the cache when an object fails to get instantiated', function() { + expect(function() { + injector.get('idontexist'); + }).toThrowMinErr("$injector", "unpr", "Unknown provider: idontexistProvider <- idontexist"); + + expect(function() { + injector.get('idontexist'); + }).toThrowMinErr("$injector", "unpr", "Unknown provider: idontexistProvider <- idontexist"); + }); + + it('should provide path to the missing provider', function() { providers('a', function(idontexist) {return 1;}); providers('b', function(a) {return 2;}); |
