-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathweb-test-runner.config.js
40 lines (39 loc) · 1010 Bytes
/
web-test-runner.config.js
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
40
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { playwrightLauncher } from '@web/test-runner-playwright';
import { fileURLToPath } from 'url';
export default {
rootDir: '.',
files: 'src/**/*.test.ts', // "default" group
concurrentBrowsers: 3,
nodeResolve: {
exportConditions: ['production', 'default'],
},
testFramework: {
config: {
timeout: 3000,
retries: 1,
},
},
plugins: [
esbuildPlugin({
ts: true,
tsconfig: fileURLToPath(new URL('./tsconfig.json', import.meta.url)),
}),
],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'webkit' }),
],
testRunnerHtml: testFramework => `
<html lang="en-US">
<head></head>
<body>
<script>
window.process = {env: { NODE_ENV: "production" }}
</script>
<script type="module" src="${testFramework}"></script>
</body>
</html>
`,
};