From c0b557a96c72dc5be0a698efe01654d0295e1e49 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 31 Oct 2011 12:46:00 -0700 Subject: 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. --- test/ScopeSpec.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'test') 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); + } }); -- cgit v1.2.3