Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use process exit listener instead of process.exit() #224

Merged
merged 1 commit into from
Jan 23, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
});
});