Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export function checkVersionMismatch(
) {
const versionMatcher = func.toString().match(LWC_VERSION_COMMENT_REGEX);
if (!isNull(versionMatcher) && !warned) {
if (process.env.SKIP_LWC_VERSION_MISMATCH_CHECK === 'true') {
warned = true; // skip printing out version mismatch errors when env var is set
return;
}

const version = versionMatcher[1];
if (version !== LWC_VERSION) {
warned = true; // only warn once to avoid flooding the console
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,23 @@ 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:`));
expect(dispatcher).not.toHaveBeenCalled();
});

it('template', () => {
function tmpl() {
return [];
Expand Down
Loading