From 37123cd2858b4e318ed8109af745312df4848577 Mon Sep 17 00:00:00 2001 From: Ken Sheedlo Date: Tue, 13 Aug 2013 15:30:52 -0700 Subject: feat(minerr): log minerr doc url in development Closes #3566 --- test/ng/animateSpec.js | 2 +- test/ng/cacheFactorySpec.js | 2 +- test/ng/compileSpec.js | 54 ++++++++-------- test/ng/controllerSpec.js | 2 +- test/ng/directive/booleanAttrsSpec.js | 10 +-- test/ng/directive/inputSpec.js | 4 +- test/ng/directive/ngRepeatSpec.js | 10 +-- test/ng/directive/ngSrcSpec.js | 12 ++-- test/ng/directive/selectSpec.js | 2 +- test/ng/interpolateSpec.js | 16 ++--- test/ng/locationSpec.js | 10 +-- test/ng/parseSpec.js | 116 +++++++++++++++++----------------- test/ng/rootScopeSpec.js | 12 ++-- test/ng/sceSpecs.js | 76 +++++++++++----------- 14 files changed, 164 insertions(+), 164 deletions(-) (limited to 'test/ng') diff --git a/test/ng/animateSpec.js b/test/ng/animateSpec.js index 2e9034e4..79115c1e 100644 --- a/test/ng/animateSpec.js +++ b/test/ng/animateSpec.js @@ -44,7 +44,7 @@ describe("$animate", function() { module(function($animateProvider) { expect(function() { $animateProvider.register('abc', null); - }).toThrow("[$animate:notcsel] Expecting class selector starting with '.' got 'abc'."); + }).toThrowMinErr("$animate", "notcsel", "Expecting class selector starting with '.' got 'abc'."); }); inject(); }); diff --git a/test/ng/cacheFactorySpec.js b/test/ng/cacheFactorySpec.js index c398a55e..b1a018da 100644 --- a/test/ng/cacheFactorySpec.js +++ b/test/ng/cacheFactorySpec.js @@ -15,7 +15,7 @@ describe('$cacheFactory', function() { it('should complain if the cache id is being reused', inject(function($cacheFactory) { $cacheFactory('cache1'); expect(function() { $cacheFactory('cache1'); }). - toThrow("[$cacheFactory:iid] CacheId 'cache1' is already taken!"); + toThrowMinErr("$cacheFactory", "iid", "CacheId 'cache1' is already taken!"); })); diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index ba94c48b..28dc57fe 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -632,11 +632,11 @@ describe('$compile', function() { inject(function($compile) { expect(function() { $compile('

'); - }).toThrow("[$compile:tplrt] Template for directive 'noRootElem' must have exactly one root element. "); + }).toThrowMinErr("$compile", "tplrt", "Template for directive 'noRootElem' must have exactly one root element. "); expect(function() { $compile('

'); - }).toThrow("[$compile:tplrt] Template for directive 'multiRootElem' must have exactly one root element. "); + }).toThrowMinErr("$compile", "tplrt", "Template for directive 'multiRootElem' must have exactly one root element. "); // ws is ok expect(function() { @@ -748,7 +748,7 @@ describe('$compile', function() { expect(function() { $templateCache.put('http://example.com/should-not-load.html', 'Should not load even if in cache.'); $compile('
')($rootScope); - }).toThrow('[$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: http://example.com/should-not-load.html'); + }).toThrowMinErr('$sce', 'insecurl', 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: http://example.com/should-not-load.html'); })); it('should load cross domain templates when trusted', inject( @@ -1011,7 +1011,7 @@ describe('$compile', function() { expect(function() { $httpBackend.flush(); - }).toThrow('[$compile:tpload] Failed to load template: hello.html'); + }).toThrowMinErr('$compile', 'tpload', 'Failed to load template: hello.html'); expect(sortedHtml(element)).toBe('
'); } )); @@ -1031,7 +1031,7 @@ describe('$compile', function() { inject(function($compile){ expect(function() { $compile('
'); - }).toThrow('[$compile:multidir] Multiple directives [sync, async] asking for template on: '+ + }).toThrowMinErr('$compile', 'multidir', 'Multiple directives [sync, async] asking for template on: '+ '
'); }); }); @@ -1215,14 +1215,14 @@ describe('$compile', function() { $compile('

'); $rootScope.$digest(); expect($exceptionHandler.errors.pop().message). - toBe("[$compile:tplrt] Template for directive 'template' must have exactly one root element. template.html"); + toMatch(/\[\$compile:tplrt\] Template for directive 'template' must have exactly one root element\. template\.html/); // multi root $templateCache.put('template.html', '
'); $compile('

'); $rootScope.$digest(); expect($exceptionHandler.errors.pop().message). - toBe("[$compile:tplrt] Template for directive 'template' must have exactly one root element. template.html"); + toMatch(/\[\$compile:tplrt\] Template for directive 'template' must have exactly one root element\. template\.html/); // ws is ok $templateCache.put('template.html', '
\n'); @@ -1482,7 +1482,7 @@ describe('$compile', function() { function($rootScope, $compile) { expect(function(){ $compile('
'); - }).toThrow('[$compile:multidir] Multiple directives [iscopeA, scopeB] asking for isolated scope on: ' + + }).toThrowMinErr('$compile', 'multidir', 'Multiple directives [iscopeA, scopeB] asking for isolated scope on: ' + '
'); }) ); @@ -1492,7 +1492,7 @@ describe('$compile', function() { function($rootScope, $compile) { expect(function(){ $compile('
'); - }).toThrow('[$compile:multidir] Multiple directives [iscopeA, iscopeB] asking for isolated scope on: ' + + }).toThrowMinErr('$compile', 'multidir', 'Multiple directives [iscopeA, iscopeB] asking for isolated scope on: ' + '
'); }) ); @@ -2110,7 +2110,7 @@ describe('$compile', function() { componentScope.ref = 'ignore me'; expect($rootScope.$apply). - toThrow("[$compile:nonassign] Expression ''hello ' + name' used with directive 'myComponent' is non-assignable!"); + toThrowMinErr("$compile", "nonassign", "Expression ''hello ' + name' used with directive 'myComponent' is non-assignable!"); expect(componentScope.ref).toBe('hello world'); // reset since the exception was rethrown which prevented phase clearing $rootScope.$$phase = null; @@ -2186,7 +2186,7 @@ describe('$compile', function() { it('should throw on unknown definition', inject(function() { expect(function() { compile('
'); - }).toThrow("[$compile:iscp] Invalid isolate scope definition for directive 'badDeclaration'. Definition: {... attr: 'xxx' ...}"); + }).toThrowMinErr("$compile", "iscp", "Invalid isolate scope definition for directive 'badDeclaration'. Definition: {... attr: 'xxx' ...}"); })); it('should expose a $$isolateBindings property onto the scope', inject(function() { @@ -2329,7 +2329,7 @@ describe('$compile', function() { inject(function(log, $compile, $rootScope) { expect(function() { $compile('
')($rootScope); - }).toThrow("[$compile:ctreq] Controller 'main', required by directive 'dep', can't be found!"); + }).toThrowMinErr("$compile", "ctreq", "Controller 'main', required by directive 'dep', can't be found!"); }); }); @@ -2724,7 +2724,7 @@ describe('$compile', function() { inject(function($compile) { expect(function() { $compile('
'); - }).toThrow('[$compile:multidir] Multiple directives [first, second] asking for transclusion on: ' + + }).toThrowMinErr('$compile', 'multidir', 'Multiple directives [first, second] asking for transclusion on: ' + '
'); }); }); @@ -3147,18 +3147,18 @@ describe('$compile', function() { $rootScope.onClickJs = ""; expect(function() { $compile('