Skip to content

Commit

Permalink
test(integration-karma): silence lwc rollup plugin warnings (#2836)
Browse files Browse the repository at this point in the history
* test(integration-karma): silence lwc rollup plugin warnings

* fix: use warn API
  • Loading branch information
nolanlawson authored May 19, 2022
1 parent a941e33 commit 6812585
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ async function getCompiledModule(dirName) {
cache,

external: ['lwc', 'test-utils', '@test/loader'], // @todo: add ssr modules for test-utils and @test/loader

onwarn(warning, warn) {
// Ignore warnings from our own Rollup plugin
if (warning.plugin !== 'rollup-plugin-lwc-compiler') {
warn(warning);
}
},
});

const { watchFiles } = bundle;
Expand Down
7 changes: 7 additions & 0 deletions packages/integration-karma/scripts/karma-plugins/lwc.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ function createPreprocessor(config, emitter, logger) {
// Rollup should not attempt to resolve the engine and the test utils, Karma takes care of injecting it
// globally in the page before running the tests.
external: ['lwc', 'wire-service', 'test-utils', '@test/loader'],

onwarn(warning, warn) {
// Ignore warnings from our own Rollup plugin
if (warning.plugin !== 'rollup-plugin-lwc-compiler') {
warn(warning);
}
},
});

watcher.watchSuite(input, bundle.watchFiles);
Expand Down

0 comments on commit 6812585

Please sign in to comment.