diff options
Diffstat (limited to 'test/auto')
| -rw-r--r-- | test/auto/injectorSpec.js | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/test/auto/injectorSpec.js b/test/auto/injectorSpec.js index 8fd03be4..b59a344f 100644 --- a/test/auto/injectorSpec.js +++ b/test/auto/injectorSpec.js @@ -70,7 +70,7 @@ describe('injector', function() { it('should provide useful message if no provider', function() { expect(function() { injector.get('idontexist'); - }).toThrow("Unknown provider: idontexistProvider <- idontexist"); + }).toThrow("[NgErr1] Unknown provider: idontexistProvider <- idontexist"); }); @@ -79,7 +79,7 @@ describe('injector', function() { providers('b', function(a) {return 2;}); expect(function() { injector.get('b'); - }).toThrow("Unknown provider: idontexistProvider <- idontexist <- a <- b"); + }).toThrow("[NgErr1] Unknown provider: idontexistProvider <- idontexist <- a <- b"); }); @@ -127,10 +127,10 @@ describe('injector', function() { it('should fail with errors if not function or array', function() { expect(function() { injector.invoke({}); - }).toThrow("Argument 'fn' is not a function, got Object"); + }).toThrow("[NgErr45] Argument 'fn' is not a function, got Object"); expect(function() { injector.invoke(['a', 123], {}); - }).toThrow("Argument 'fn' is not a function, got number"); + }).toThrow("[NgErr45] Argument 'fn' is not a function, got number"); }); }); @@ -268,7 +268,8 @@ describe('injector', function() { it('should error on invalid module name', function() { expect(function() { createInjector(['IDontExist'], {}); - }).toThrow("No module: IDontExist"); + }).toThrow("[NgErr47] Module 'IDontExist' is not available! You either misspelled the module name or forgot to load it."); + }); @@ -551,7 +552,7 @@ describe('injector', function() { createInjector([ {} ], {}); - }).toThrow("Argument 'module' is not a function, got Object"); + }).toThrow("[NgErr45] Argument 'module' is not a function, got Object"); }); @@ -568,7 +569,7 @@ describe('injector', function() { angular.module('TestModule', [], function(xyzzy) {}); expect(function() { createInjector(['TestModule']); - }).toThrow('Unknown provider: xyzzy from TestModule'); + }).toThrow('[NgErr1] Unknown provider: xyzzy from TestModule'); }); @@ -576,7 +577,7 @@ describe('injector', function() { function myModule(xyzzy){} expect(function() { createInjector([myModule]); - }).toThrow('Unknown provider: xyzzy from ' + myModule); + }).toThrow('[NgErr1] Unknown provider: xyzzy from ' + myModule); }); @@ -584,7 +585,7 @@ describe('injector', function() { function myModule(xyzzy){} expect(function() { createInjector([['xyzzy', myModule]]); - }).toThrow('Unknown provider: xyzzy from ' + myModule); + }).toThrow('[NgErr1] Unknown provider: xyzzy from ' + myModule); }); @@ -594,7 +595,7 @@ describe('injector', function() { $provide.factory('service', function(service){}); return function(service) {} }]) - }).toThrow('Circular dependency: service'); + }).toThrow("[NgErr4] Circular dependency found: service"); }); @@ -605,7 +606,7 @@ describe('injector', function() { $provide.factory('b', function(a){}); return function(a) {} }]) - }).toThrow('Circular dependency: b <- a'); + }).toThrow('[NgErr4] Circular dependency found: b <- a'); }); }); }); @@ -695,7 +696,7 @@ describe('injector', function() { it('should throw usefull error on wrong argument type]', function() { expect(function() { $injector.invoke({}); - }).toThrow("Argument 'fn' is not a function, got Object"); + }).toThrow("[NgErr45] Argument 'fn' is not a function, got Object"); }); }); @@ -782,7 +783,7 @@ describe('injector', function() { }]); expect(function() { $injector.get('nameProvider'); - }).toThrow("Unknown provider: nameProviderProvider <- nameProvider"); + }).toThrow("[NgErr1] Unknown provider: nameProviderProvider <- nameProvider"); }); @@ -790,7 +791,7 @@ describe('injector', function() { var $injector = createInjector([]); expect(function() { $injector.get('$provide').value('a', 'b'); - }).toThrow("Unknown provider: $provideProvider <- $provide"); + }).toThrow("[NgErr1] Unknown provider: $provideProvider <- $provide"); }); @@ -800,7 +801,7 @@ describe('injector', function() { createInjector([function($provide) { $provide.value('name', 'angular') }, instanceLookupInModule]); - }).toThrow('Unknown provider: name from ' + String(instanceLookupInModule)); + }).toThrow('[NgErr1] Unknown provider: name from ' + String(instanceLookupInModule)); }); }); }); |
