Welcome to mirror list, hosted at ThFree Co, Russian Federation.

00-verify-ls-ok.js « tap « test - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aa6acdbc56f8aca45a98c87244fc79ae054303b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var common = require("../common-tap")
var test = require("tap").test
var path = require("path")
var cwd = path.resolve(__dirname, "..", "..")
var fs = require("fs")

test("npm ls in npm", function (t) {
  t.ok(fs.existsSync(cwd), "ensure that the path we are calling ls within exists")
  var files = fs.readdirSync(cwd)
  t.notEqual(files.length, 0, "ensure there are files in the directory we are to ls")

  var opt = { cwd: cwd, stdio: [ "ignore", "ignore", 2 ] }
  common.npm(["ls"], opt, function (err, code) {
    t.ifError(err, "error should not exist")
    t.equal(code, 0, "npm ls exited with code")
    t.end()
  })
})