node/deps/npm/test/tap/invalid-cmd-exit-code.js
isaacs f76c3938d0 npm: upgrade to v1.4.8
* Check SHA before using files from cache
* adduser: allow change of the saved password
* Make `npm install` respect `config.unicode`
* Fix lifecycle to pass `Infinity` for config env value
* Don't return 0 exit code on invalid command
* cache: Handle 404s and other HTTP errors as errors
* bump tap dep, make tests stderr a bit quieter
* Resolve ~ in path configs to env.HOME
* Include npm version in default user-agent conf
* npm init: Use ISC as default license, use save-prefix for deps
* Many test and doc fixes
2014-05-01 11:09:00 -07:00

30 lines
719 B
JavaScript

var test = require("tap").test
var node = process.execPath
var common = require("../common-tap.js")
var opts = { cwd: process.cwd() }
test("npm asdf should return exit code 1", function(t) {
common.npm(["asdf"], opts, function (er, c) {
if (er) throw er
t.ok(c, "exit code should not be zero")
t.end()
})
})
test("npm help should return exit code 0", function(t) {
common.npm(["help"], opts, function (er, c) {
if (er) throw er
t.equal(c, 0, "exit code should be 0")
t.end()
})
})
test("npm help fadf should return exit code 0", function(t) {
common.npm(["help", "fadf"], opts, function (er, c) {
if (er) throw er
t.equal(c, 0, "exit code should be 0")
t.end()
})
})