diff options
| author | Ken Sheedlo | 2013-08-13 15:30:52 -0700 | 
|---|---|---|
| committer | Ken Sheedlo | 2013-08-15 13:23:18 -0700 | 
| commit | 37123cd2858b4e318ed8109af745312df4848577 (patch) | |
| tree | 118abe5fd50e1c6fef4281972cf52c0162482fa8 /test/auto | |
| parent | fe267e30b95e8f48ddc670b97d485f18fb64d39e (diff) | |
| download | angular.js-37123cd2858b4e318ed8109af745312df4848577.tar.bz2 | |
feat(minerr): log minerr doc url in development
Closes #3566
Diffstat (limited to 'test/auto')
| -rw-r--r-- | test/auto/injectorSpec.js | 39 | 
1 files changed, 19 insertions, 20 deletions
| diff --git a/test/auto/injectorSpec.js b/test/auto/injectorSpec.js index 2c485655..efed2aa4 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("[$injector:unpr] Unknown provider: idontexistProvider <- idontexist"); +    }).toThrowMinErr("$injector", "unpr", "Unknown provider: idontexistProvider <- idontexist");    }); @@ -79,7 +79,7 @@ describe('injector', function() {      providers('b', function(a) {return 2;});      expect(function() {        injector.get('b'); -    }).toThrow("[$injector:unpr] Unknown provider: idontexistProvider <- idontexist <- a <- b"); +    }).toThrowMinErr("$injector", "unpr", "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("[ng:areq] Argument 'fn' is not a function, got Object"); +      }).toThrowMinErr("ng", "areq", "Argument 'fn' is not a function, got Object");        expect(function() {          injector.invoke(['a', 123], {}); -      }).toThrow("[ng:areq] Argument 'fn' is not a function, got number"); +      }).toThrowMinErr("ng", "areq", "Argument 'fn' is not a function, got number");      });    }); @@ -268,9 +268,8 @@ describe('injector', function() {      it('should error on invalid module name', function() {        expect(function() {          createInjector(['IDontExist'], {}); -      }).toThrowMatching( -          /\[\$injector:modulerr\].+\n.*\[\$injector:nomod] Module 'IDontExist' is not available! You either misspelled the module name or forgot to load it/ -      ); +      }).toThrowMinErr('$injector', 'modulerr', +        /\[\$injector:nomod\] Module 'IDontExist' is not available! You either misspelled the module name or forgot to load it/);      }); @@ -553,7 +552,7 @@ describe('injector', function() {            createInjector([              {}            ], {}); -        }).toThrowMatching(/\[\$injector:modulerr\] Failed to instantiate module {} due to:\n.*\[ng\:areq] Argument 'module' is not a function, got Object/); +        }).toThrowMinErr('$injector', 'modulerr', /Failed to instantiate module \{\} due to:\n.*\[ng:areq\] Argument 'module' is not a function, got Object/);        }); @@ -562,7 +561,7 @@ describe('injector', function() {            createInjector([function() {              throw 'MyError';            }], {}); -        }).toThrowMatching(/\[\$injector:modulerr\] Failed to instantiate module .+ due to:\n.*MyError/); +        }).toThrowMinErr('$injector', 'modulerr', /Failed to instantiate module .+ due to:\n.*MyError/);        }); @@ -570,8 +569,8 @@ describe('injector', function() {          angular.module('TestModule', [], function(xyzzy) {});          expect(function() {            createInjector(['TestModule' ]); -        }).toThrowMatching( -            /\[\$injector:modulerr\] Failed to instantiate module TestModule due to:\n.*\[\$injector:unpr] Unknown provider: xyzzy/ +        }).toThrowMinErr( +          '$injector', 'modulerr', /Failed to instantiate module TestModule due to:\n.*\[\$injector:unpr] Unknown provider: xyzzy/          );        }); @@ -580,8 +579,8 @@ describe('injector', function() {          function myModule(xyzzy){}          expect(function() {            createInjector([myModule]); -        }).toThrowMatching( -            /\[\$injector:modulerr\] Failed to instantiate module function myModule\(xyzzy\) due to:\n.*\[\$injector:unpr] Unknown provider: xyzzy/ +        }).toThrowMinErr( +          '$injector', 'modulerr', /Failed to instantiate module function myModule\(xyzzy\) due to:\n.*\[\$injector:unpr] Unknown provider: xyzzy/          );        }); @@ -590,8 +589,8 @@ describe('injector', function() {          function myModule(xyzzy){}          expect(function() {            createInjector([['xyzzy', myModule]]); -        }).toThrowMatching( -            /\[\$injector:modulerr\] Failed to instantiate module function myModule\(xyzzy\) due to:\n.*\[\$injector:unpr] Unknown provider: xyzzy/ +        }).toThrowMinErr( +          '$injector', 'modulerr', /Failed to instantiate module function myModule\(xyzzy\) due to:\n.*\[\$injector:unpr] Unknown provider: xyzzy/          );        }); @@ -602,7 +601,7 @@ describe('injector', function() {              $provide.factory('service', function(service){});              return function(service) {}            }]) -        }).toThrow("[$injector:cdep] Circular dependency found: service"); +        }).toThrowMinErr('$injector', 'cdep', 'Circular dependency found: service');        }); @@ -613,7 +612,7 @@ describe('injector', function() {              $provide.factory('b', function(a){});              return function(a) {}            }]) -        }).toThrow('[$injector:cdep] Circular dependency found: b <- a'); +        }).toThrowMinErr('$injector', 'cdep', 'Circular dependency found: b <- a');        });      });    }); @@ -703,7 +702,7 @@ describe('injector', function() {      it('should throw usefull error on wrong argument type]', function() {        expect(function() {          $injector.invoke({}); -      }).toThrow("[ng:areq] Argument 'fn' is not a function, got Object"); +      }).toThrowMinErr("ng", "areq", "Argument 'fn' is not a function, got Object");      });    }); @@ -790,7 +789,7 @@ describe('injector', function() {        }]);        expect(function() {          $injector.get('nameProvider'); -      }).toThrow("[$injector:unpr] Unknown provider: nameProviderProvider <- nameProvider"); +      }).toThrowMinErr("$injector", "unpr", "Unknown provider: nameProviderProvider <- nameProvider");      }); @@ -798,7 +797,7 @@ describe('injector', function() {        var  $injector = createInjector([]);        expect(function() {          $injector.get('$provide').value('a', 'b'); -      }).toThrow("[$injector:unpr] Unknown provider: $provideProvider <- $provide"); +      }).toThrowMinErr("$injector", "unpr", "Unknown provider: $provideProvider <- $provide");      }); | 
