Skip to content

Commit ad128e0

Browse files
caitptbosch
authored andcommitted
test($rootScope): add assertion to test ensuring that NaN -> NaN does not throw
angular@fb6062f 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 angular#6758
1 parent 187b4ad commit ad128e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: test/ng/rootScopeSpec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,9 @@ describe('Scope', function() {
605605

606606
it('should not infinitely digest when current value is NaN', function() {
607607
$rootScope.obj = [NaN];
608-
$rootScope.$digest();
608+
expect(function() {
609+
$rootScope.$digest();
610+
}).not.toThrow();
609611
});
610612

611613
it('should watch array-like objects like arrays', function () {

0 commit comments

Comments
 (0)