node/deps/npm/test/tap/ls-no-results.js

13 lines
368 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

var test = require('tap').test
var spawn = require('child_process').spawn
var node = process.execPath
var npm = require.resolve('../../')
var args = [ npm, 'ls', 'ceci nest pas une package' ]
test('ls exits non-zero when nothing found', function (t) {
var child = spawn(node, args)
child.on('exit', function (code) {
t.notEqual(code, 0)
t.end()
})
})