diff options
| author | Igor Minar | 2011-10-31 12:46:00 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-10-31 12:46:12 -0700 | 
| commit | c0b557a96c72dc5be0a698efe01654d0295e1e49 (patch) | |
| tree | 0ebf1df22a750114a8de1efda661c2bba5ffc19e /test/ScopeSpec.js | |
| parent | 84873e7f4eacae7d71605b2368ee746fe30a25e3 (diff) | |
| download | angular.js-c0b557a96c72dc5be0a698efe01654d0295e1e49.tar.bz2 | |
test(scope): infinite digest test should pass on all browsers
Different browsers print function body differently, and best of all IE doesn't have
function.name property.
Diffstat (limited to 'test/ScopeSpec.js')
| -rw-r--r-- | test/ScopeSpec.js | 13 | 
1 files changed, 5 insertions, 8 deletions
| diff --git a/test/ScopeSpec.js b/test/ScopeSpec.js index e1f8181e..d3f58918 100644 --- a/test/ScopeSpec.js +++ b/test/ScopeSpec.js @@ -237,15 +237,12 @@ describe('Scope', function() {        root.$watch(function() {return root.b;}, function(self){self.a++;});        root.a = root.b = 0; -      expect(function() { +      try {          root.$digest(); -      }).toThrow('100 $digest() iterations reached. Aborting!\n'+ -          'Watchers fired in the last 5 iterations: ' + -          '[["fn: watcherA","fn: function () {return root.b;}"],'+ -           '["fn: watcherA","fn: function () {return root.b;}"],'+ -           '["fn: watcherA","fn: function () {return root.b;}"],'+ -           '["fn: watcherA","fn: function () {return root.b;}"],'+ -           '["fn: watcherA","fn: function () {return root.b;}"]]'); +        throw Error('Should have thrown exception'); +      } catch(e) { +        expect(e.message.match(/"fn: (watcherA|function)/g).length).toBe(10); +      }      }); | 
