mirror of
https://github.com/zhigang1992/npm.git
synced 2026-06-20 11:58:45 +08:00
22 lines
410 B
JavaScript
22 lines
410 B
JavaScript
var test = require("tap").test
|
|
var fs = require("../fs.js")
|
|
|
|
var readdir = fs.readdir
|
|
fs.readdir = function(path, cb) {
|
|
process.nextTick(function() {
|
|
cb(null, ["b", "z", "a"])
|
|
})
|
|
}
|
|
|
|
var g = require("../")
|
|
|
|
test("readdir reorder", function (t) {
|
|
g.readdir("whatevers", function (er, files) {
|
|
if (er)
|
|
throw er
|
|
console.error(files)
|
|
t.same(files, [ "a", "b", "z" ])
|
|
t.end()
|
|
})
|
|
})
|