Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/jest-cli/src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const readResultsAndExit = (
) => {
const code = !result || result.success ? 0 : globalConfig.testFailureExitCode;

process.on('exit', () => exit(code));
process.on('exit', () => (process.exitCode = code));

if (globalConfig.forceExit) {
exit(code);
Expand Down
7 changes: 3 additions & 4 deletions packages/jest-runtime/src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type {Argv} from 'types/Argv';
import type {EnvironmentClass} from 'types/Environment';

import chalk from 'chalk';
import exit from 'exit';
Copy link
Member

@SimenB SimenB Feb 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be removed from dependencies as well? Some quick grepping says yes

import os from 'os';
import path from 'path';
import yargs from 'yargs';
Expand Down Expand Up @@ -43,7 +42,7 @@ export function run(cliArgv?: Argv, cliInfo?: Array<string>) {

if (argv.help) {
yargs.showHelp();
process.on('exit', () => exit(1));
process.on('exit', () => (process.exitCode = 1));
return;
}

Expand All @@ -54,7 +53,7 @@ export function run(cliArgv?: Argv, cliInfo?: Array<string>) {

if (!argv._.length) {
console.log('Please provide a path to a script. (See --help for details)');
process.on('exit', () => exit(1));
process.on('exit', () => (process.exitCode = 1));
return;
}

Expand Down Expand Up @@ -93,6 +92,6 @@ export function run(cliArgv?: Argv, cliInfo?: Array<string>) {
})
.catch(e => {
console.error(chalk.red(e.stack || e));
process.on('exit', () => exit(1));
process.on('exit', () => (process.exitCode = 1));
});
}