mirror of https://github.com/lukechilds/node.git
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.
35 lines
738 B
35 lines
738 B
var test = require("tap").test
|
|
|
|
var some = require("../some.js")
|
|
|
|
test("some() array base case", function (t) {
|
|
some([], failer, function (error, match) {
|
|
t.ifError(error, "ran successfully")
|
|
|
|
t.notOk(match, "nothing to find, so nothing found")
|
|
|
|
t.end()
|
|
})
|
|
|
|
function failer(value, cb) {
|
|
cb(new Error("test should never have been called"))
|
|
}
|
|
})
|
|
|
|
test("some() arguments arraylike base case", function (t) {
|
|
go()
|
|
|
|
function go() {
|
|
some(arguments, failer, function (error, match) {
|
|
t.ifError(error, "ran successfully")
|
|
|
|
t.notOk(match, "nothing to find, so nothing found")
|
|
|
|
t.end()
|
|
})
|
|
|
|
function failer(value, cb) {
|
|
cb(new Error("test should never have been called"))
|
|
}
|
|
}
|
|
})
|
|
|