Permalink
Browse files

workaround for windows to ensure console.log is always flushed before…

… process.exit
  • Loading branch information...
malonecj committed Aug 6, 2014
1 parent e2a4705 commit 3e66e456f4c612126053483508d89f4751966f45
Showing with 12 additions and 4 deletions.
  1. +12 −4 bin/jest.js
View
@@ -321,7 +321,9 @@ function _main(onComplete) {
if (argv.help) {
optimist.showHelp();
process.exit(0);
process.on('exit', function(){
process.exit(0);
});
}
var cwd = process.cwd();
@@ -358,7 +360,9 @@ function _main(onComplete) {
'installed globally.\n' +
'Please upgrade this project past Jest version 0.1.5'
);
process.exit(1);
process.on('exit', function(){
process.exit(1);
});
}
jestBinary.runCLI(argv, cwdPackageRoot, onComplete);
@@ -381,7 +385,9 @@ function _main(onComplete) {
'Please run `npm install` to use the version of Jest intended for ' +
'this project.'
);
process.exit(1);
process.on('exit', function(){
process.exit(1);
});
}
}
@@ -396,6 +402,8 @@ exports.runCLI = runCLI;
if (require.main === module) {
harmonize();
_main(function (success) {
process.exit(success ? 0 : 1);
process.on('exit', function(){
process.exit(success ? 0 : 1);
});
});
}

0 comments on commit 3e66e45

Please sign in to comment.