Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make assert.epsilon fail for NaN actual value
It makes sense than NaN would not be within a tolerance of a number. but since Math.abs(NaN) = NaN and NaN > x evalutes to false for all numeric x, assert.epsilon will pass if NaN is passed as the 'actual' argument. I could not determine how to use vows to assert that an assertion would fail, so there is no test case for this change, but the existing tests pass. I'm not sure asserting that an assertion will fail is possible with the library's promise-oriented design. This bug was originally found while working on the jStat project which relies on vows; if the vows team does not want to make assert.epsilon fail for NaN actual value, it would be good to have an additional method that would check both that the argument is a number and within the tolerance.
- Loading branch information