Closed adamschmideg closed 11 years ago
+1
I'm hitting this same issue when writing a restify pull request. I also think it would make things a lot cleaner if NaN
failed for assert.number(NaN)
Agreed. Should be easy to fix.
On Thu, Apr 18, 2013 at 10:34 AM, Bryce Baril notifications@github.comwrote:
+1
I'm hitting this same issue when writing a restify pull request. I also think it would make things a lot cleaner if NaN failed for assert.number(NaN)
— Reply to this email directly or view it on GitHubhttps://github.com/mcavage/node-assert-plus/issues/4#issuecomment-16590965 .
Node that assert-plus@1.0.0 changed this again to allow infinity in assert.number
(e.g. Infinity
) and added assert.finite
. I can't help but think that disallowing Infinity for assert.number
wasn't totally expected/intended.
I'd expect assert.number(NaN) to fail, but it doesn't. Either it should fail, or you can add assert.finite which fails for NaN.