-
Notifications
You must be signed in to change notification settings - Fork 55
/
wtr.config.ts
56 lines (52 loc) · 1.28 KB
/
wtr.config.ts
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
import { fileURLToPath, pathToFileURL } from 'node:url';
import { parseArgs } from 'node:util';
import { vitePlugin, removeViteLogging } from '@remcovaes/web-test-runner-vite-plugin';
import { chromeLauncher } from '@web/test-runner';
import viteConfig from './vite.config.js';
const cwd = pathToFileURL(`${process.cwd()}/`);
const {
values: { coverage, watch: _watch },
} = parseArgs({
options: {
watch: {
type: 'boolean',
short: 'w',
},
coverage: {
type: 'boolean',
},
},
strict: false,
});
const isCI = !!process.env.CI;
const watch = !!_watch && !isCI;
// eslint-disable-next-line import/no-anonymous-default-export
export default {
concurrency: 10,
// nodeResolve: true,
watch,
coverage,
rootDir: fileURLToPath(cwd),
files: 'test/**/*.spec.{ts,tsx}',
coverageConfig: {
include: [fileURLToPath(new URL('src/**/*', cwd))],
reportDir: fileURLToPath(new URL('.coverage/', cwd)),
},
plugins: [vitePlugin(viteConfig)],
filterBrowserLogs: removeViteLogging,
browsers: [
chromeLauncher({
launchOptions: {
args: [],
// eslint-disable-next-line no-undef
executablePath: process.env.CHROME_BIN,
},
}),
],
testFramework: {
config: {
ui: 'bdd',
timeout: '4000',
},
},
};