mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
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.
This commit is contained in:
parent
84873e7f4e
commit
c0b557a96c
1 changed files with 5 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue