-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
vitest.config.ts
33 lines (29 loc) · 930 Bytes
/
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
import { defineVitestConfig } from '@nuxt/test-utils/config'
import GithubActionsReporter from 'vitest-github-actions-reporter'
export default defineVitestConfig({
esbuild: {
tsconfigRaw: {
compilerOptions: {
// Enable decorators, workaround for https://github.com/unjs/nitro/issues/1380
experimentalDecorators: true,
},
},
},
test: {
// Provide global API
// https://vitest.dev/config/#globals
globals: true,
// Run before each test file
// https://vitest.dev/config/#setupfiles
setupFiles: ['test/global.setup.ts'],
// Code coverage
// https://vitest.dev/config/#coverage and https://vitest.dev/guide/coverage.html
coverage: {
reporter: ['json', 'text'],
},
// Create annotations when tests fail in GitHub Actions
reporters: process.env.GITHUB_ACTIONS
? ['default', new GithubActionsReporter()]
: 'default',
},
})