-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
43 lines (40 loc) · 1.12 KB
/
vitest.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
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
const job = (() => {
if (process.env.TRAVIS) {
return `TRAVIS ${process.env.TRAVIS_BUILD_ID}#${process.env.TRAVIS_BUILD_NUMBER}`;
}
if (process.env.GITLAB_CI) {
return `GITLAB ${process.env.CI_JOB_ID}#${process.env.CI_JOB_NAME}`;
}
if (process.env.GITHUB_ACTIONS) {
return `GITHUB ${process.env.GITHUB_JOB}#${process.env.GITHUB_RUN_NUMBER}`;
}
return null;
})();
export default defineConfig({
esbuild: {
include: /\.(m?(t|j)s|[jt]sx)$/,
target: ['es2020'],
},
resolve: {
alias: {
'@chialab/dna': fileURLToPath(new URL('./src/index.ts', import.meta.url)),
},
},
test: {
name: `DNA${job ? ` (${job})` : ''}`,
dir: './test',
include: ['./*.spec.js'],
coverage: {
all: false,
include: ['src'],
reporter: [['clover'], ['html']],
},
browser: {
headless: true,
name: 'chromium',
provider: 'playwright',
},
},
});