Skip to content

Commit de2acf2

Browse files
committed
Add filterBrowserLogs for web-test-runner config
1 parent 5b84d4b commit de2acf2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

web-test-runner.config.mjs

+14
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,22 @@ import { fromRollup } from '@web/dev-server-rollup'
33

44
const json = fromRollup(rollupJson)
55

6+
const filteredLogs = [
7+
'Lit is in dev mode. Not recommended for production! See https://lit.dev/msg/dev-mode for more information.'
8+
]
9+
10+
const filterBrowserLogs = (log) => {
11+
for (const arg of log.args) {
12+
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
13+
return false
14+
}
15+
}
16+
return true
17+
}
18+
619
export default {
720
nodeResolve: true,
21+
filterBrowserLogs,
822
mimeTypes: {
923
'**/*.json': 'js'
1024
},

0 commit comments

Comments
 (0)