Skip to content

Commit

Permalink
Add filterBrowserLogs for web-test-runner config
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth committed Sep 24, 2024
1 parent 5b84d4b commit de2acf2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions web-test-runner.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
},
Expand Down

0 comments on commit de2acf2

Please sign in to comment.