-
Notifications
You must be signed in to change notification settings - Fork 405
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
test(ssr): add tests for @wire
errors
#4915
Conversation
'expected.html': '', | ||
'error.txt': message ?? '', | ||
}; | ||
} |
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 figure we might as well start testing compiler errors in engine-server
. It's convenient for SSR tests since they effectively do double-duty as a compiler and runtime.
const message = err?.message?.match(/(LWC\d+[^\n]+)/)?.[1]; | ||
return { | ||
'expected.html': '', | ||
'error.txt': message ?? '', |
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.
'error.txt': message ?? '', | |
'error.txt': err?.message ?? '', |
Unless @lwc/errors
is weird, err.message
doesn't include the stack.
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.
err.message
does include the stack here because the error actually comes from Babel-via-Rollup.
Also if err?.message
is nullish, then message
will be nullish as well.
Details
Follow-up to #4910. This doesn't test all the
@wire
errors, but it's a start.These are copied from the
wire-decorator/throws-*
tests inbabel-plugin-component
.Does this pull request introduce a breaking change?
Does this pull request introduce an observable change?