-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb-test-runner.config.mjs
91 lines (77 loc) · 2.39 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { playwrightLauncher } from '@web/test-runner-playwright';
import { defaultReporter } from '@web/test-runner';
import { junitReporter } from '@web/test-runner-junit-reporter';
const exclude = [
'rollup.config.js',
'serviceWorker.js',
'workbox-config.js',
'web-dev-server.config.js',
'web-test-runner.config.js',
'configs/**/*',
'.storybook/**/*',
'node_modules/**/*',
'components/*/test/*.js',
'components/*/stories/*.js',
'components/golfleet-app/**/*',
'components/golfleet-store/**/*',
'components/golfleet-polyfill/**/*',
'components/golfleet-drag-n-drop/**/*',
'components/golfleet-fetch-pattern/**/*',
];
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
/** Test files to run */
files: [ 'components/golfleet-login/test/**/*.test.js' ],
/** Browsers to run tests on */
browsers: [
// playwrightLauncher({ product: 'webkit' }),
// playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'chromium' }),
],
/** Resolve bare module imports */
nodeResolve: {
exportConditions: ['browser', 'development'],
},
/** Amount of test files per browser to test concurrently */
concurrency: 1,
/** Amount of browsers to run concurrently */
concurrentBrowsers: 3,
/** Code coverage configuration */
coverage: true,
coverageConfig: {
include: [ 'components/*/src/**/*.js' ],
exclude: [...exclude],
threshold: {
lines: 90,
branches: 90,
functions: 90,
statements: 90,
},
report: true,
reportDir: './coverage/',
reporters: ['lcov'],
nativeInstrumentation: true,
},
/** Test timeout configuration */
testFramework: {
config: {
timeout: 1.5 * 60 * 1000,
},
},
testsStartTimeout: 2 * 60 * 1000,
testsFinishTimeout: 2 * 60 * 1000,
browserStartTimeout: 5 * 60 * 1000,
/** Test report configuration */
report: true,
reporters: [
// use the default reporter only for reporting test progress
defaultReporter({ reportTestResults: true, reportTestProgress: true }),
// use another reporter to report test results
junitReporter({
outputPath: './coverage/junit.xml', // default `'./test-results.xml'`
reportLogs: false, // default `false`
}),
],
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
// esbuildTarget: 'auto',
// See documentation for all available options
});