Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c0b557a

Browse files
committed
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.
1 parent 84873e7 commit c0b557a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/ScopeSpec.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,12 @@ describe('Scope', function() {
237237
root.$watch(function() {return root.b;}, function(self){self.a++;});
238238
root.a = root.b = 0;
239239

240-
expect(function() {
240+
try {
241241
root.$digest();
242-
}).toThrow('100 $digest() iterations reached. Aborting!\n'+
243-
'Watchers fired in the last 5 iterations: ' +
244-
'[["fn: watcherA","fn: function () {return root.b;}"],'+
245-
'["fn: watcherA","fn: function () {return root.b;}"],'+
246-
'["fn: watcherA","fn: function () {return root.b;}"],'+
247-
'["fn: watcherA","fn: function () {return root.b;}"],'+
248-
'["fn: watcherA","fn: function () {return root.b;}"]]');
242+
throw Error('Should have thrown exception');
243+
} catch(e) {
244+
expect(e.message.match(/"fn: (watcherA|function)/g).length).toBe(10);
245+
}
249246
});
250247

251248

0 commit comments

Comments
 (0)