-
Notifications
You must be signed in to change notification settings - Fork 46
/
web-test-runner.config.mjs
39 lines (37 loc) · 1.1 KB
/
web-test-runner.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { playwrightLauncher } from '@web/test-runner-playwright';
const silencedLogs = [
'Lit is in dev mode.',
'Multiple versions of Lit loaded.',
];
/** @type {import('@web/test-runner').TestRunnerConfig} */
export default {
nodeResolve: true,
files: 'packages/**/*.test.ts',
plugins: [esbuildPlugin({ ts: true, target: 'auto-always' })],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'webkit' }),
],
filterBrowserLogs(log) {
for (const arg of log.args) {
if (typeof arg === 'string' && silencedLogs.some(l => arg.includes(l))) {
return false;
}
}
return true;
},
testRunnerHtml: testFramework =>
`<html>
<head>
<link rel="stylesheet" href="/packages/uui-css/dist/uui-css.css">
</head>
<body>
<script type="module" src="${testFramework}"></script>
<script type="module">
import 'element-internals-polyfill';
</script>
</body>
</html>`,
};