aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/directive
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/directive')
-rw-r--r--test/ng/directive/booleanAttrsSpec.js10
-rw-r--r--test/ng/directive/inputSpec.js4
-rw-r--r--test/ng/directive/ngRepeatSpec.js10
-rw-r--r--test/ng/directive/ngSrcSpec.js12
-rw-r--r--test/ng/directive/selectSpec.js2
5 files changed, 19 insertions, 19 deletions
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('<select multiple="{{isMultiple}}"></select>')
- }).toThrow('[$compile:selmulti] Binding to the \'multiple\' attribute is not supported. ' +
+ }).toThrowMinErr('$compile', 'selmulti', 'Binding to the \'multiple\' attribute is not supported. ' +
'Element: <select multiple="{{isMultiple}}">');
}));
@@ -137,8 +137,8 @@ describe('ngSrc', function() {
expect(function() {
var element = $compile('<div ng-src="some/{{id}}"></div>')($rootScope);
dealoc(element);
- }).toThrow(
- "[$interpolate:noconcat] Error while interpolating: some/{{id}}\nStrict " +
+ }).toThrowMinErr(
+ "$interpolate", "noconcat", "Error while interpolating: some/{{id}}\nStrict " +
"Contextual Escaping disallows interpolations that concatenate multiple expressions " +
"when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce");
}));
@@ -162,8 +162,8 @@ describe('ngSrc', function() {
$rootScope.id = $sce.trustAsUrl('http://somewhere');
});
element.attr('src');
- }).toThrow(
- "[$interpolate:interr] Can't interpolate: {{id}}\nError: [$sce:insecurl] Blocked " +
+ }).toThrowMinErr(
+ "$interpolate", "interr", "Can't interpolate: {{id}}\nError: [$sce:insecurl] Blocked " +
"loading resource from url not allowed by $sceDelegate policy. URL: http://somewhere");
}));
diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js
index a69a4195..facc2b80 100644
--- a/test/ng/directive/inputSpec.js
+++ b/test/ng/directive/inputSpec.js
@@ -43,7 +43,7 @@ describe('NgModelController', function() {
}
expect(exception.message).
- toMatch(/^\[ngModel:nonassign\] Expression '1\+2' is non\-assignable\. Element: <input( value="")? ng-model="1\+2">$/);
+ toMatch(/^\[ngModel:nonassign\] Expression '1\+2' is non\-assignable\. Element: <input( value="")? ng-model="1\+2">/);
}));
@@ -457,7 +457,7 @@ describe('input', function() {
expect(function() {
compileInput('<input type="text" ng-model="throw \'\'">');
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('<ul><li ng-repeat="i dont parse"></li></ul>');
$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('<ul><li ng-repeat="i dont parse in foo"></li></ul>');
$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('<iframe ng-src="{{testUrl}}"></iframe>')($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('<iframe ng-src="{{testUrl}}"></iframe>')($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('<iframe ng-src="{{testUrl}}"></iframe>')($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('<select ng-model="selected" ng-options="i dont parse"></select>');
- }).toThrowMatching(/^\[ngOptions:iexp\] Expected expression in form of/);
+ }).toThrowMinErr('ngOptions', 'iexp', /Expected expression in form of/);
});