Don't return 0 exit code on invalid command #4781

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

@evanlucas

Fixes #4780

@domenic domenic commented on the diff Feb 25, 2014
test/tap/invalid-cmd-exit-code.js
+ createChild(process.cwd(), node, [npm, 'help'])
+ .on('close', function(c) {
+ t.equal(c, 0, 'exit code should be 0')
+ t.end()
+ })
+})
+
+test('npm help fadf should return exit code 0', function(t) {
+ createChild (process.cwd(), node, [npm, 'help', 'fadf'])
+ .on('close', function(c) {
+ t.equal(c, 0, 'exit code should be 0')
+ t.end()
+ })
+})
+
+function createChild (cwd, cmd, args) {
@domenic
domenic Feb 25, 2014 npm member

I think we have a helper in common-tap for this?

@evanlucas
evanlucas Feb 25, 2014

Ah. Is that new? I hadn't seen it before. I'll get it updated shortly.

@domenic
domenic Feb 25, 2014 npm member

Yeah it's new. Not sure it's perfect for your use case though so if it doesn't work that's fine.

@robertkowalski
robertkowalski Feb 25, 2014 npm member

The helper is not merged yet: #4757

@domenic
Member
domenic commented Apr 18, 2014

A version of this using @robertkowalski's newly-merged helper is now merged as 057d9b7.

@domenic domenic closed this Apr 18, 2014
@othiym23 othiym23 added the bug label Sep 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment