-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add --detectOpenHandles flag
#6130
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
Changes from 1 commit
2a74f80
4a7f44a
b6f7276
74f0006
2950383
2dfa609
11b0434
c07c9e3
ce04b4d
2e19046
eaaf3a5
fd2dd3a
dc55ef1
93217dc
bf5e587
1b15451
a3ea1aa
a67c258
82595e3
b4cf302
1c8c356
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,7 +128,26 @@ const readResultsAndExit = ( | |
| process.on('exit', () => (process.exitCode = code)); | ||
|
|
||
| if (globalConfig.forceExit) { | ||
| if (!globalConfig.detectOpenHandles) { | ||
| console.error( | ||
| chalk.red( | ||
| 'Force exiting Jest - have you considered using `--detectOpenHandles`?', | ||
| ), | ||
| ); | ||
| } | ||
|
|
||
| exit(code); | ||
| } else if (!globalConfig.detectOpenHandles) { | ||
| setTimeout(() => { | ||
| const lines = [ | ||
| chalk.red.bold( | ||
| 'Jest has not exited 1000ms after the test run finished', | ||
|
||
| ), | ||
| chalk.red('Have you considered using `--detectOpenHandles`?'), | ||
| ]; | ||
| console.error(lines.join('\n\n')); | ||
| // $FlowFixMe: `unref` exists in Node | ||
| }, 1000).unref(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice |
||
| } | ||
| }; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about ending with
[…] to detect async operations that kept running after all tests finished?