%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/1857783/root/usr/local/lib/node_modules/latest/node_modules/npm/test/tap/
Upload File :
Create Path :
Current File : //proc/1857783/root/usr/local/lib/node_modules/latest/node_modules/npm/test/tap/test-run-ls.js

var common = require("../common-tap.js")
var test = require("tap").test
var path = require("path")
var cwd = path.resolve(__dirname, "..", "..")
var testscript = require("../../package.json").scripts.test
var tsregexp = testscript.replace(/([\[\.\*\]])/g, "\\$1")

test("default", function (t) {
  common.npm(["run"], { cwd: cwd }, function (er, code, so) {
    if (er) throw er
    t.notOk(code)
    t.similar(so, new RegExp("\\n  test\\n    " + tsregexp + "\\n"))
    t.end()
  })
})

test("parseable", function (t) {
  common.npm(["run", "-p"], { cwd: cwd }, function (er, code, so) {
    if (er) throw er
    t.notOk(code)
    t.similar(so, new RegExp("\\ntest:" + tsregexp + "\\n"))
    t.end()
  })
})

test("parseable", function (t) {
  common.npm(["run", "--json"], { cwd: cwd }, function (er, code, so) {
    if (er) throw er
    t.notOk(code)
    t.equal(JSON.parse(so).test, testscript)
    t.end()
  })
})

Zerion Mini Shell 1.0