Skip to content

Commit

Permalink
test($rootScope): add assertion to test ensuring that NaN -> NaN does…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
caitp committed Mar 20, 2014
1 parent b26fc23 commit 6011145
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/ng/rootScopeSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 6011145

Please sign in to comment.