1 var common = require("../common-tap")
2 var test = require("tap").test
3 var path = require("path")
4 var cwd = path.resolve(__dirname, "..", "..")
7 test("npm ls in npm", function (t) {
8 t.ok(fs.existsSync(cwd), "ensure that the path we are calling ls within exists")
9 var files = fs.readdirSync(cwd)
10 t.notEqual(files.length, 0, "ensure there are files in the directory we are to ls")
12 var opt = { cwd: cwd, stdio: [ "ignore", "ignore", 2 ] }
13 common.npm(["ls"], opt, function (err, code) {
14 t.ifError(err, "error should not exist")
15 t.equal(code, 0, "npm ls exited with code")