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
feat(jest-cli): add forceExitAfterTestRun avg #1847
Conversation
const success = !result || result.success; | ||
process.on('exit', () => process.exit(success ? 0 : 1)); | ||
|
||
if (argv.forceExitAfterTestRun === true) process.exit(success ? 0 : 1); |
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.
our code style requires curly braces here.
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.
done :)
@@ -261,6 +261,12 @@ const options = { | |||
'Will run all tests affected by file changes in the last commit made.', | |||
type: 'boolean', | |||
}, | |||
forceExitAfterTestRun: { |
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.
I'm not a fan of this name. Can we call it forceExit
or exitOnComplete
or something similar?
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.
ok, change to forceExit
forceExitAfterTestRun: { | ||
default: false, | ||
description: | ||
'After run all tests that force exit.', |
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.
'Force Jest to exit after all tests have completed running. This is useful when resources set up by test code cannot be adequately cleaned up.'
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.
done :)
aabcb89
to
3f2710f
Compare
After run all tests that force exit when forceExit is true jestjs#1456
3f2710f
to
fff2730
Compare
…estjs#1847) (jestjs#1870) * feat(jest-cli): add forceExit avg on cli After run all tests that force exit when forceExit is true jestjs#1456 * Fix typecheck & linter offences * Improve null check expression * Update index.js
…estjs#1847) (jestjs#1870) * feat(jest-cli): add forceExit avg on cli After run all tests that force exit when forceExit is true jestjs#1456 * Fix typecheck & linter offences * Improve null check expression * Update index.js
The test run wouldn't exit because of the async call. This forces it to exit even if it can't correctly clean up after the tests. Referenced here: jestjs/jest#1847.
…estjs#1847) (jestjs#1870) * feat(jest-cli): add forceExit avg on cli After run all tests that force exit when forceExit is true jestjs#1456 * Fix typecheck & linter offences * Improve null check expression * Update index.js
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
After run all tests that force exit when forceExitAfterTestRun is true
#1456