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/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 +- 5 files changed, 19 insertions(+), 19 deletions(-) (limited to 'test/ng/directive') diff --git a/test/ng/directive/booleanAttrsSpec.js b/test/ng/directive/booleanAttrsSpec.js index 82639051..83bc75e5 100644 --- a/test/ng/directive/booleanAttrsSpec.js +++ b/test/ng/directive/booleanAttrsSpec.js @@ -93,7 +93,7 @@ describe('boolean attr directives', function() { expect(function() { $compile('') - }).toThrow('[$compile:selmulti] Binding to the \'multiple\' attribute is not supported. ' + + }).toThrowMinErr('$compile', 'selmulti', 'Binding to the \'multiple\' attribute is not supported. ' + 'Element: '); scope.$digest(); - }).toThrow("[$parse:syntax] Syntax Error: Token '''' is an unexpected token at column 7 of the expression [throw ''] starting at ['']."); + }).toThrowMinErr("$parse", "syntax", "Syntax Error: Token '''' is an unexpected token at column 7 of the expression [throw ''] starting at ['']."); }); diff --git a/test/ng/directive/ngRepeatSpec.js b/test/ng/directive/ngRepeatSpec.js index 35b9f897..fc41bc6d 100644 --- a/test/ng/directive/ngRepeatSpec.js +++ b/test/ng/directive/ngRepeatSpec.js @@ -77,7 +77,7 @@ describe('ngRepeat', function() { expect(element.find('li').length).toEqual(3); expect(element.text()).toEqual('x;y;x;'); }); - + it('should iterate over an array-like class', function() { function Collection() {} Collection.prototype = new Array(); @@ -350,7 +350,7 @@ describe('ngRepeat', function() { element = jqLite(''); $compile(element)(scope); expect($exceptionHandler.errors.shift()[0].message). - toBe("[ngRepeat:iexp] Expected expression in form of '_item_ in _collection_[ track by _id_]' but got 'i dont parse'."); + toMatch(/^\[ngRepeat:iexp\] Expected expression in form of '_item_ in _collection_\[ track by _id_\]' but got 'i dont parse'\./); }); @@ -358,7 +358,7 @@ describe('ngRepeat', function() { element = jqLite(''); $compile(element)(scope); expect($exceptionHandler.errors.shift()[0].message). - toBe("[ngRepeat:iidexp] '_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got 'i dont parse'."); + toMatch(/^\[ngRepeat:iidexp\] '_item_' in '_item_ in _collection_' should be an identifier or '\(_key_, _value_\)' expression, but got 'i dont parse'\./); }); @@ -773,7 +773,7 @@ describe('ngRepeat', function() { scope.items = [a, a, a]; scope.$digest(); expect($exceptionHandler.errors.shift().message). - toEqual("[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: item in items, Duplicate key: object:003"); + toMatch(/^\[ngRepeat:dupes\] Duplicates in a repeater are not allowed\. Use 'track by' expression to specify unique keys\. Repeater: item in items, Duplicate key: object:003/); // recover scope.items = [a]; @@ -793,7 +793,7 @@ describe('ngRepeat', function() { scope.items = [d, d, d]; scope.$digest(); expect($exceptionHandler.errors.shift().message). - toEqual("[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: item in items, Duplicate key: object:009"); + toMatch(/^\[ngRepeat:dupes\] Duplicates in a repeater are not allowed\. Use 'track by' expression to specify unique keys\. Repeater: item in items, Duplicate key: object:009/); // recover scope.items = [a]; diff --git a/test/ng/directive/ngSrcSpec.js b/test/ng/directive/ngSrcSpec.js index 2fb99eab..3dc00257 100644 --- a/test/ng/directive/ngSrcSpec.js +++ b/test/ng/directive/ngSrcSpec.js @@ -26,8 +26,8 @@ describe('ngSrc', function() { it('should error on src attributes for a different domain', inject(function($compile, $rootScope) { element = $compile('')($rootScope); $rootScope.testUrl = "http://a.different.domain.example.com"; - expect(function() { $rootScope.$apply() }).toThrow( - "[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " + + expect(function() { $rootScope.$apply() }).toThrowMinErr( + "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " + "loading resource from url not allowed by $sceDelegate policy. URL: " + "http://a.different.domain.example.com"); })); @@ -35,8 +35,8 @@ describe('ngSrc', function() { it('should error on JS src attributes', inject(function($compile, $rootScope) { element = $compile('')($rootScope); $rootScope.testUrl = "javascript:alert(1);"; - expect(function() { $rootScope.$apply() }).toThrow( - "[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " + + expect(function() { $rootScope.$apply() }).toThrowMinErr( + "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " + "loading resource from url not allowed by $sceDelegate policy. URL: " + "javascript:alert(1);"); })); @@ -44,8 +44,8 @@ describe('ngSrc', function() { it('should error on non-resource_url src attributes', inject(function($compile, $rootScope, $sce) { element = $compile('')($rootScope); $rootScope.testUrl = $sce.trustAsUrl("javascript:doTrustedStuff()"); - expect($rootScope.$apply).toThrow( - "[$interpolate:interr] Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " + + expect($rootScope.$apply).toThrowMinErr( + "$interpolate", "interr", "Can't interpolate: {{testUrl}}\nError: [$sce:insecurl] Blocked " + "loading resource from url not allowed by $sceDelegate policy. URL: " + "javascript:doTrustedStuff()"); })); diff --git a/test/ng/directive/selectSpec.js b/test/ng/directive/selectSpec.js index 5be7eb65..5906ce99 100644 --- a/test/ng/directive/selectSpec.js +++ b/test/ng/directive/selectSpec.js @@ -494,7 +494,7 @@ describe('select', function() { it('should throw when not formated "? for ? in ?"', function() { expect(function() { compile(''); - }).toThrowMatching(/^\[ngOptions:iexp\] Expected expression in form of/); + }).toThrowMinErr('ngOptions', 'iexp', /Expected expression in form of/); }); -- cgit v1.2.3