Skip to content

Commit

Permalink
Put back original error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Deveaud committed Jun 17, 2016
1 parent bce6960 commit 424dd4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bin/mocha-phantomjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ program.on('--help', function(){

program.parse(process.argv);

if (!program.args.length) { program.outputHelp(); process.exitCode = 9; return; };
if (!program.args.length) { program.outputHelp(); process.exitCode = 1; return; };
if (program.agent) { settings.userAgent = program.agent; }

var script = require.resolve('mocha-phantomjs-core/mocha-phantomjs-core.js');
Expand Down Expand Up @@ -132,7 +132,7 @@ if (program.path) {
phantomPath = path.resolve(program.path);
if (!exists(phantomPath)) {
console.error("PhantomJS does not exist at '" + program.path + "'");
process.exitCode = 127;
process.exitCode = -2;
return;
}
} else {
Expand All @@ -144,7 +144,7 @@ function launchFailure(e) {
if (!program.path) {
console.error('You can specify an explicit path to phantomjs via the `-p` option.');
}
process.exitCode = 1;
process.exitCode = -2;
}

var unknown = program.parseOptions(process.argv).unknown.filter(function(u) {
Expand Down
2 changes: 1 addition & 1 deletion test/mocha-phantomjs.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe 'mocha-phantomjs', ->

it 'returns a failure code and shows usage when no args are given', ->
{ code, stdout } = yield run []
code.should.equal 9
code.should.equal 1
stdout.should.match /Usage: mocha-phantomjs/

it 'returns a failure code and notifies of bad url when given one', ->
Expand Down

0 comments on commit 424dd4a

Please sign in to comment.