aboutsummaryrefslogtreecommitdiffstats
path: root/test/matchers.js
diff options
context:
space:
mode:
authorIgor Minar2013-05-24 11:00:14 -0700
committerVojta Jina2013-05-24 17:03:21 -0700
commitb8ea7f6aba2e675b85826b0bee1f21ddd7b866a5 (patch)
treef3b34e25e27d088bec9b698b246d49f86281de36 /test/matchers.js
parent88eaea8e7bf025a7805a5d20f5d47472e4f26f6f (diff)
downloadangular.js-b8ea7f6aba2e675b85826b0bee1f21ddd7b866a5.tar.bz2
feat(ngError): add error message compression and better error messages
- add toThrowNg matcher
Diffstat (limited to 'test/matchers.js')
-rw-r--r--test/matchers.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/matchers.js b/test/matchers.js
index 8e4be118..13d284e6 100644
--- a/test/matchers.js
+++ b/test/matchers.js
@@ -147,8 +147,12 @@ beforeEach(function() {
return this.actual.hasClass ?
this.actual.hasClass(clazz) :
angular.element(this.actual).hasClass(clazz);
- }
+ },
+ toThrowNg: function(expected) {
+ return jasmine.Matchers.prototype.toThrow.call(this, new RegExp('\\[NgErr\\d*\\] ' +
+ expected.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")));
+ }
});
});