-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix(testServer): add location to config loading errors #35710
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
base: main
Are you sure you want to change the base?
fix(testServer): add location to config loading errors #35710
Conversation
This comment has been minimized.
This comment has been minimized.
183f0e5
to
83d9787
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
This brings more questions than answers 😄
@@ -418,7 +418,17 @@ export class TestServerDispatcher implements TestServerInterface { | |||
} | |||
return { config }; | |||
} catch (e) { | |||
return { config: null, error: serializeError(e) }; | |||
const error: reporterTypes.TestError = serializeError(e); | |||
if (e.name === 'SyntaxError' && e.code === 'BABEL_PARSE_ERROR' && this._configLocation.resolvedConfigFile) { |
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.
We should find a better place for this. At least in utils. Don't we have such code somewhere already? Perhaps serializeError()
should do that automatically and always set location
?
83d9787
to
d7abd99
Compare
This comment has been minimized.
This comment has been minimized.
d7abd99
to
d926aea
Compare
Test results for "tests 1"2 failed 6 flaky39093 passed, 803 skipped Merge workflow run. |
When having e.g. a
SyntaxError
or athrow new Error
inside a config and using the VSCode extension, there was no error shown in the problems tab. This is because we didn't add thelocation
property to theTestError
which we sent back over to VSCode.Looks like it regressed when migrating to TestServer. Or a bit after it. When using CLI, we add the
location
property` here.