-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Watch for test files are crashed #4614
Conversation
@@ -470,6 +470,7 @@ async function runMochaWatchJSONAsync(args, opts, change) { | |||
// eslint-disable-next-line no-control-regex | |||
.replace(/\u001b\[\?25./g, '') | |||
.split('\u001b[2K') | |||
.filter(x => x) |
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 filtered output because the output is an empty string(''
) when a test file is crashed.
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.
Your bug fix lgtm, but the tests are a little weird.
Signed-off-by: Outsider <[email protected]>
Signed-off-by: Outsider <[email protected]>
f0f7458
to
b6b4eef
Compare
Fixed |
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 forgot to approve this PR. Yes, approved.
Description of the Change
In watch mode, the watcher crashed when there are syntax errors in test files during
require('test file')
.It only happens in serial mode and Node v15+.
This
try - catch
statement removed when we introduce parallel mode.I think we need
try - catch
here.And I added test cases for the crash case to prevent regression.
Why should this be in core?
Watching should be worked.
Benefits
Users can use watch mode when the test code is broken.
Applicable issues
Fix #4580