-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathweb-test-runner.config.mjs
More file actions
49 lines (48 loc) · 1.15 KB
/
web-test-runner.config.mjs
File metadata and controls
49 lines (48 loc) · 1.15 KB
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
41
42
43
44
45
46
47
48
49
import { playwrightLauncher } from '@web/test-runner-playwright';
export default {
nodeResolve: true,
browsers: [
playwrightLauncher({
product: 'chromium',
launchOptions: {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
timeout: 20000
}
}),
playwrightLauncher({ product: 'firefox' }),
],
testFramework: {
config: {
timeout: '20000',
},
},
files: ['test/**/*.test.js'],
middleware: [
function rewriteBase(context, next) {
if (context.url.startsWith('/base/')) {
context.url = context.url.replace('/base/', '/');
}
return next();
}
],
testRunnerHtml: testFramework => `
<html>
<head>
<script type="module">
// Set a base path for resources
const base = document.createElement('base');
base.href = '/';
document.head.appendChild(base);
</script>
</head>
<body>
<script type="module" src="${testFramework}"></script>
</body>
</html>
`,
browserStartTimeout: 60000,
testsStartTimeout: 60000,
testsFinishTimeout: 60000,
concurrentBrowsers: 1,
concurrency: 1
};