Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
really fic PR feedback
  • Loading branch information
SimenB committed May 6, 2018
commit 1c8c356725285c974f8cece58bafc195c05c99f6
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ exports[`CLI accepts exact file names if matchers matched 1`] = `

Force exiting Jest

Have you considered using \`--detectOpenHandles\`?

to detect async operations that kept running after all tests finished?"
Have you considered using \`--detectOpenHandles\` to detect async operations that kept running after all tests finished?"
`;

exports[`CLI accepts exact file names if matchers matched 2`] = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ exports[`prints console.logs when run with forceExit 1`] = `

Force exiting Jest

Have you considered using \`--detectOpenHandles\`?

to detect async operations that kept running after all tests finished?"
Have you considered using \`--detectOpenHandles\` to detect async operations that kept running after all tests finished?"
`;

exports[`prints console.logs when run with forceExit 2`] = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
exports[`prints message about flag on forceExit 1`] = `
"Force exiting Jest

Have you considered using \`--detectOpenHandles\`?

to detect async operations that kept running after all tests finished?"
Have you considered using \`--detectOpenHandles\` to detect async operations that kept running after all tests finished?"
`;

exports[`prints message about flag on slow tests 1`] = `
Expand Down
21 changes: 10 additions & 11 deletions packages/jest-cli/src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const readResultsAndExit = (
console.error(
chalk.red.bold('Force exiting Jest\n\n') +
chalk.red(
'Have you considered using `--detectOpenHandles`?\n\n to detect ' +
'Have you considered using `--detectOpenHandles` to detect ' +
'async operations that kept running after all tests finished?',
),
);
Expand All @@ -141,17 +141,16 @@ const readResultsAndExit = (
exit(code);
} else if (!globalConfig.detectOpenHandles) {
setTimeout(() => {
const lines = [
console.error(
chalk.red.bold(
'Jest did not exit one second after the test run has completed.',
),
chalk.red(
'This usually means that there are asynchronous operations that ' +
"weren't stopped in your tests. Consider running Jest with " +
'`--detectOpenHandles` to troubleshoot this issue.',
),
];
console.error(lines.join('\n\n'));
'Jest did not exit one second after the test run has completed.\n\n',
) +
chalk.red(
'This usually means that there are asynchronous operations that ' +
"weren't stopped in your tests. Consider running Jest with " +
'`--detectOpenHandles` to troubleshoot this issue.',
),
);
// $FlowFixMe: `unref` exists in Node
}, 1000).unref();
Copy link
Member

Choose a reason for hiding this comment

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

nice

}
Expand Down