Skip to content

Commit

Permalink
Merge pull request #224 from jquense/fix-truncated-windows-output
Browse files Browse the repository at this point in the history
use process exit listener instead of process.exit()
  • Loading branch information
jeffmo committed Jan 23, 2015
2 parents c1334ea + 6eaf8ca commit 9ff8238
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions bin/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ var argv = optimist

if (argv.help) {
optimist.showHelp();
process.exit(0);

process.on('exit', function(){
process.exit(1);
});

return;
}

var cwd = process.cwd();
Expand Down Expand Up @@ -145,7 +150,12 @@ if (fs.existsSync(cwdJestBinPath)) {
'installed globally.\n' +
'Please upgrade this project past Jest version 0.1.5'
);
process.exit(1);

process.on('exit', function(){
process.exit(1);
});

return;
}
} else {
// Otherwise, load this version of Jest.
Expand All @@ -165,7 +175,12 @@ if (fs.existsSync(cwdJestBinPath)) {
'Please run `npm install` to use the version of Jest intended for ' +
'this project.'
);
process.exit(1);

process.on('exit', function(){
process.exit(1);
});

return;
}
}
}
Expand All @@ -175,5 +190,7 @@ if (!argv.version) {
}

jest.runCLI(argv, cwdPackageRoot, function (success) {
process.exit(success ? 0 : 1);
process.on('exit', function(){
process.exit(success ? 0 : 1);
});
});

0 comments on commit 9ff8238

Please sign in to comment.