diff options
| author | Igor Minar | 2013-05-24 11:00:14 -0700 | 
|---|---|---|
| committer | Vojta Jina | 2013-05-24 17:03:21 -0700 | 
| commit | b8ea7f6aba2e675b85826b0bee1f21ddd7b866a5 (patch) | |
| tree | f3b34e25e27d088bec9b698b246d49f86281de36 /test/ng/directive/inputSpec.js | |
| parent | 88eaea8e7bf025a7805a5d20f5d47472e4f26f6f (diff) | |
| download | angular.js-b8ea7f6aba2e675b85826b0bee1f21ddd7b866a5.tar.bz2 | |
feat(ngError): add error message compression and better error messages
- add toThrowNg matcher
Diffstat (limited to 'test/ng/directive/inputSpec.js')
| -rw-r--r-- | test/ng/directive/inputSpec.js | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js index f8898074..68caf1f5 100644 --- a/test/ng/directive/inputSpec.js +++ b/test/ng/directive/inputSpec.js @@ -43,7 +43,7 @@ describe('NgModelController', function() {      }      expect(exception.message). -        toMatch(/Non-assignable model expression: 1\+2 \(<input( value="")? ng-model="1\+2">\)/); +        toMatch(/^\[NgErr6\] ngModel error! 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("Syntax Error: Token '''' is an unexpected token at column 7 of the expression [throw ''] starting at ['']."); +    }).toThrow("[NgErr24] Syntax Error: Token '''' is an unexpected token at column 7 of the expression [throw ''] starting at [''].");    }); @@ -548,11 +548,11 @@ describe('input', function() {      }); -    xit('should throw an error when scope pattern can\'t be found', function() { -      compileInput('<input type="text" ng-model="foo" ng-pattern="fooRegexp" />'); - -      expect(function() { changeInputValueTo('xx'); }). -          toThrow('Expected fooRegexp to be a RegExp but was undefined'); +    it('should throw an error when scope pattern can\'t be found', function() { +      expect(function() { +        compileInput('<input type="text" ng-model="foo" ng-pattern="fooRegexp" />'); +        scope.$apply(); +      }).toThrowNg('ngPattern error! Expected fooRegexp to be a RegExp but was undefined.');      });    }); | 
