-
Notifications
You must be signed in to change notification settings - Fork 439
fix: add environment variable to disable LWC version mismatch loglines #5187
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
Changes from 2 commits
7397767
d135dbf
c451d88
55cb8f5
1ed3c8a
f529365
3386121
abae28b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,9 +48,27 @@ describe('compiler version mismatch', () => { | |||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| afterEach(() => { | ||||||||||||||
| process.env.SKIP_LWC_VERSION_MISMATCH_CHECK = 'false'; | ||||||||||||||
| detachReportingControlDispatcher(); | ||||||||||||||
| }); | ||||||||||||||
|
|
||||||||||||||
| it('skip warning during local dev', () => { | ||||||||||||||
| process.env.SKIP_LWC_VERSION_MISMATCH_CHECK = 'true'; | ||||||||||||||
| function tmpl() { | ||||||||||||||
| return []; | ||||||||||||||
| /*LWC compiler v123.456.789*/ | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| expect(() => { | ||||||||||||||
| registerTemplate(tmpl); | ||||||||||||||
| }).not.toLogErrorDev( | ||||||||||||||
| new RegExp( | ||||||||||||||
| `LWC WARNING: current engine is v${process.env.LWC_VERSION}, but template was compiled with v123.456.789` | ||||||||||||||
| ) | ||||||||||||||
| ); | ||||||||||||||
|
||||||||||||||
| }).not.toLogErrorDev( | |
| new RegExp( | |
| `LWC WARNING: current engine is v${process.env.LWC_VERSION}, but template was compiled with v123.456.789` | |
| ) | |
| ); | |
| }).not.toLogErrorDev(/v123\.456\.789/); |
Checking that we're not logging such a long message feels easy to get an accidental false positive, if the error text ever changes. We should just check for keywords to be more flexible.
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.
sure I can make it more generic
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.
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.
was just being extra cautious - I didn't know how things were compiled (and what is shipped to the browser vs whats available in server side engine). Didn't want to unintentionally break something for this one usecase.