make watch plugin initialization errors look nice#8422
Conversation
be3dac5 to
d674117
Compare
const e = new Error(
`Failed to initialize watch plugin '${
pluginWithConfig.path
}':\n\n${formatExecError(err, contexts[0].config, {
noStackTrace: false,
})}`,
);
// or `delete` it
e.stack = '';
return Promise.reject(e);Does that work? I like the "Test suite failed to run" text, just getting rid of the outer stack trace should make it nice and clean 🙂 |
|
|
|
Ah, the good old absolute path on CI. Well, I'll take care of that tomorrow... |
| const errorWithContext = new Error( | ||
| `Failed to initialize watch plugin "${chalk.bold( | ||
| path.posix.relative(process.cwd(), pluginWithConfig.path), | ||
| path.relative(process.cwd(), pluginWithConfig.path), |
SimenB
left a comment
There was a problem hiding this comment.
CI is unhappy, but this lgtm. Really nice!
ca06354 to
ce869df
Compare
|
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. |
Summary
Follow up to jest-community/jest-watch-typeahead#29
Any idea how we could get rid of the outer stack trace and / or "Test suite failed to run"? In the current state it IMO looks worse than just the plain error. @SimenB
Edit: fixed outer stack trace, updated screenshot
Test plan
Added snapshot test.
Manual test -> see screenshot