forked from ing-bank/lion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
web-test-runner.config.mjs
58 lines (56 loc) · 1.47 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
48
49
50
51
52
53
54
55
56
57
58
import fs from 'fs';
import { playwrightLauncher } from '@web/test-runner-playwright';
const packages = fs
.readdirSync('packages')
.filter(
dir => fs.statSync(`packages/${dir}`).isDirectory() && fs.existsSync(`packages/${dir}/test`),
)
.map(dir => ({ name: dir, path: `packages/${dir}/test` }))
.concat(
fs
.readdirSync('packages/ui/components')
.filter(
dir =>
fs.statSync(`packages/ui/components/${dir}`).isDirectory() &&
fs.existsSync(`packages/ui/components/${dir}/test`),
)
.map(dir => ({ name: dir, path: `packages/ui/components/${dir}/test` })),
);
// .filter(x => x.endsWith('-dropdown'))
// .concat(
// fs
// .readdirSync('packages/helpers')
// .filter(
// dir =>
// fs.statSync(`packages/helpers/${dir}`).isDirectory() &&
// fs.existsSync(`packages/helpers/${dir}/test`),
// )
// .map(dir => `helpers/${dir}`),
// );
export default {
nodeResolve: true,
coverageConfig: {
report: true,
reportDir: 'coverage',
threshold: {
statements: 90,
branches: 65,
functions: 80,
lines: 90,
},
},
testFramework: {
config: {
timeout: '5000',
},
},
browsers: [
playwrightLauncher({ product: 'firefox', concurrency: 1 }),
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'webkit' }),
],
groups: packages.map(pkg => ({
name: pkg.name,
files: `${pkg.path}/**/*.test.js`,
})),
};