-
Notifications
You must be signed in to change notification settings - Fork 0
/
web-test-runner.config.mjs
42 lines (41 loc) · 1.22 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
import { esbuildPlugin } from '@web/dev-server-esbuild';
import { playwrightLauncher } from '@web/test-runner-playwright';
import { globbySync } from 'globby';
export default {
rootDir: '.',
files: [
'test/**/*.test.ts',
'!**/node_modules/**/*'
],
concurrentBrowsers: 3,
nodeResolve: true,
plugins: [
esbuildPlugin({
ts: true,
target: 'auto',
})
],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'webkit' })
],
testRunnerHtml: testFramework => `
<html lang="en-US">
<head></head>
<body>
<script type="module" src="test_dist/main.es.js"></script>
<script type="module" src="${testFramework}"></script>
</body>
</html>
`,
// Create a named group for every test file to enable running single tests.
// If a test file is `split-panel.test.ts` then you can run `npm run test -- --group split-panel` to run only that file's tests
// groups: globbySync('test/**/*.test.ts').map(path => {
// const groupName = path.match(/^.*\/(?<fileName>.*)\.test\.ts/).groups.fileName;
// return {
// name: groupName,
// files: path
// };
// })
};