-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathweb-test-runner.config.js
More file actions
47 lines (43 loc) · 1.07 KB
/
web-test-runner.config.js
File metadata and controls
47 lines (43 loc) · 1.07 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
import { esbuildPlugin } from '@web/dev-server-esbuild';
/**
* The timeout for all tests in milliseconds.
* If changing this, make sure to update the timeout in the GitHub Actions workflow.
*/
const TIMEOUT_MS = 25 * 1000;
/**
* Pass environment variables to the test environment.
* @type {Record<string, string>}
*/
const environment = {
PENUMBRA_LOG_START: process.env['PENUMBRA_LOG_START'] ?? 'false',
};
/** @type {import('@web/test-runner').TestRunnerConfig} */
const config = {
plugins: [esbuildPlugin({ ts: true })],
testRunnerHtml: (testFramework) => `
<html>
<head>
<script>
window.environment = ${JSON.stringify(environment)};
</script>
</head>
<body>
<script type="module" src="${testFramework}"></script>
</body>
</html>
`,
testFramework: {
config: {
timeout: TIMEOUT_MS,
},
},
testsFinishTimeout: TIMEOUT_MS,
concurrentBrowsers: 3,
coverage: true,
coverageConfig: {
include: ['src/**/*.ts'],
report: true,
reportDir: 'coverage',
},
};
export default config;