logicalparadox/chai — Issue #25: assert.isNumber is broken
Author: tristanz
Created: 2012-02-25 17:22:01+00:00
State: open

`assert.isNumber(1)` and `assert.isNumber(Number)` fails,`assert.isNumber(new Number(1))` works. This same issue comes up with your other type checks. You should probably use something more robust than `instanceof` or `typeof`, which to not cover all the cases. A solution, used by underscore.js, is:

```
coffee> Object.prototype.toString.call(1)
'[object Number]'
coffee> Object.prototype.toString.call(Number(1))
'[object Number]'
coffee> Object.prototype.toString.call(new Number(1))
'[object Number]'
```