From 6011145cfe83ffec4c0e1616cc9892b3b35a9bb4 Mon Sep 17 00:00:00 2001 From: Caitlin Potter Date: Wed, 19 Mar 2014 23:48:47 -0400 Subject: test($rootScope): add assertion to test ensuring that NaN -> NaN does not throw https://github.com/angular/angular.js/commit/fb6062fb9d83545730b993e94ac7482ffd43a62c implements a fix for NaN values causing $watchCollection to throw an infdig error. This change updates the test by adding an assertion which explains what is actually being tested a bit better, and may also provide better information in the event that the test ever fails. Closes #6758 --- test/ng/rootScopeSpec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ng/rootScopeSpec.js b/test/ng/rootScopeSpec.js index 2ea41489..86436ea8 100644 --- a/test/ng/rootScopeSpec.js +++ b/test/ng/rootScopeSpec.js @@ -605,7 +605,9 @@ describe('Scope', function() { it('should not infinitely digest when current value is NaN', function() { $rootScope.obj = [NaN]; - $rootScope.$digest(); + expect(function() { + $rootScope.$digest(); + }).not.toThrow(); }); it('should watch array-like objects like arrays', function () { -- cgit v1.2.3