Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80668 views
1
var test = require("tap").test
2
var fs = require("fs")
3
4
var readdir = fs.readdir
5
fs.readdir = function(path, cb) {
6
process.nextTick(function() {
7
cb(null, ["b", "z", "a"])
8
})
9
}
10
11
var g = require("../")
12
13
test("readdir reorder", function (t) {
14
g.readdir("whatevers", function (er, files) {
15
if (er)
16
throw er
17
console.error(files)
18
t.same(files, [ "a", "b", "z" ])
19
t.end()
20
})
21
})
22
23