A suite to track Project Diva score statistics and ratings / D4DJ event data.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
projectdivar/server/node_modules/isnumber/test/index.js

20 lines
555 B

var test = require("tape").test
var isNumber = require("../")
test("numbers", function (t) {
var ok = [0, -1231.21, 200, Math.pow(2, 53), Number.MAX_VALUE, Number.MIN_VALUE, 351351.13515151,
031, 0xff, "121", "122.1251"]
var notOk = [null, undefined, "cat", "dog", {}, {foo: "bar"}, [1,2,3], new Buffer("abc"),
Infinity, function () {}]
ok.forEach(function (n) {
t.ok(isNumber(n), "This is in fact a number.")
})
notOk.forEach(function (o) {
t.notOk(isNumber(o), "This is not a number.")
})
t.end()
})