From 07084e1c8bd4efa28b3f02aea353640af0cf37d6 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 31 Dec 2013 01:24:41 -0800 Subject: test(injector): add missing test for #5577 Add a missing test for fix that was merged via #5577 --- test/auto/injectorSpec.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/auto') 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;}); -- cgit v1.2.3