Skip to content

Commit

Permalink
chore: filter out unwanted browser logs
Browse files Browse the repository at this point in the history
  • Loading branch information
peschee committed Dec 15, 2023
1 parent 32a66fe commit 937f0b5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions web-test-runner.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ export async function rewriteDataJsonPaths(context, next) {
return next();
}

/**
* Filter unwanted browser log statements we're not really interested in when running tests.
*
* @type {import('@web/test-runner').TestRunnerConfig.filterBrowserLogs}
* @param args
* @returns {boolean}
*/
const removeUnneededLogs = ({ args }) => {
const ignoredBrowserLogs = new Set(['Lit is in dev mode. Not recommended for production! See https://lit.dev/msg/dev-mode for more information.']);

return !args.some(argument => ignoredBrowserLogs.has(argument));
};

/** @type {import('@web/dev-server').DevServerConfig} */
const config = {
nodeResolve: true,
Expand Down Expand Up @@ -144,6 +157,7 @@ const config = {
timeout: 2000,
},
},
filterBrowserLogs: removeUnneededLogs,
};

export default config;

0 comments on commit 937f0b5

Please sign in to comment.