From de2acf2a954a993fdfc57ce4732f84d43e4f2b1a Mon Sep 17 00:00:00 2001 From: Marco Roth Date: Tue, 24 Sep 2024 12:37:44 -0400 Subject: [PATCH] Add `filterBrowserLogs` for `web-test-runner` config --- web-test-runner.config.mjs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/web-test-runner.config.mjs b/web-test-runner.config.mjs index 04a770e4..f135b25c 100644 --- a/web-test-runner.config.mjs +++ b/web-test-runner.config.mjs @@ -3,8 +3,22 @@ import { fromRollup } from '@web/dev-server-rollup' const json = fromRollup(rollupJson) +const filteredLogs = [ + 'Lit is in dev mode. Not recommended for production! See https://lit.dev/msg/dev-mode for more information.' +] + +const filterBrowserLogs = (log) => { + for (const arg of log.args) { + if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) { + return false + } + } + return true +} + export default { nodeResolve: true, + filterBrowserLogs, mimeTypes: { '**/*.json': 'js' },