-
Notifications
You must be signed in to change notification settings - Fork 5
/
web-test-runner.config.mjs
59 lines (53 loc) · 1.46 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
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { fromRollup } from '@web/dev-server-rollup'
import commonjs from '@rollup/plugin-commonjs'
const immer = {
resolveImport({ source }) {
if (/immer/.test(source)) {
return '/node_modules/immer/dist/immer.umd.development.js'
}
return undefined
},
transform(context) {
return context.body.replace('{ produce }', 'produce')
},
}
const rdx = {
resolveImport({ source }) {
if(/@captaincodeman\/rdx/.test(source)) {
return '/packages/rdx/src/index.ts'
}
}
}
const config = {
groups: [
{ name: 'hydra', files: 'packages/hydra/test/**/*.test.ts' },
{ name: 'wc', files: 'packages/wc/test/**/*.test.ts' },
{ name: 'wc-material', files: 'packages/wc-material/test/**/*.test.ts' },
{ name: 'wc-vaadin', files: 'packages/wc-vaadin/test/**/*.test.ts' },
{ name: 'wc-shoelace', files: 'packages/wc-shoelace/test/**/*.test.ts' },
],
coverage: true,
nodeResolve: {
browser: true,
modulePaths: ['packages'],
},
concurrency: 1,
plugins: [
esbuildPlugin({ ts: true, js: true, target: 'auto', tsconfig: 'tsconfig.json' }),
immer,
rdx,
fromRollup(commonjs)({
exclude: [
'**/node_modules/@open-wc/**/*',
'**/node_modules/chai/**/*',
'**/node_modules/chai-dom/**/*',
'**/node_modules/sinon-chai/**/*',
]
}),
],
};
if (process.env.CI) {
delete config.concurrency
}
export default config