-
Notifications
You must be signed in to change notification settings - Fork 44
/
web-test-runner.config.mjs
47 lines (45 loc) · 1.33 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
40
41
42
43
44
45
46
47
import fs from 'fs';
import { playwrightLauncher } from '@web/test-runner-playwright';
import { apexchart } from './tools/dev-server/middlewares.mjs';
const packagesPath = 'packages/fds-components-web';
const excludedPackages = ['_helpers'];
const packages = fs
.readdirSync(packagesPath)
.filter((dir) => excludedPackages.includes(dir) === false)
.filter((dir) => fs.statSync(`${packagesPath}/${dir}`).isDirectory() && fs.existsSync(`${packagesPath}/${dir}/test`));
export default {
nodeResolve: true,
coverageConfig: {
report: true,
reportDir: 'wc-coverage',
threshold: {
statements: 80,
branches: 65,
functions: 80,
lines: 80
},
exclude: ['**/node_modules/**', '**/*.css.ts']
},
testFramework: {
config: {
timeout: '3000'
}
},
testRunnerHtml: (testFramework) =>
`<html>
<body>
<script>window.process = { env: { NODE_ENV: "development" } }</script>
<script type="module" src="${testFramework}"></script>
</body>
</html>`,
middleware: [apexchart],
browsers: [
//playwrightLauncher({ product: 'firefox', concurrency: 1 }),
playwrightLauncher({ product: 'chromium' })
//playwrightLauncher({ product: 'webkit' }),
],
groups: packages.map((pkg) => ({
name: pkg,
files: `${packagesPath}/${pkg}/dist/test/**/*.test.js`
}))
};