-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
32 lines (31 loc) · 1004 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
import swc from 'unplugin-swc';
import tsconfigPaths from 'vite-tsconfig-paths';
import { defineConfig } from 'vitest/config';
export default defineConfig({
cacheDir: '.vitest',
test: {
setupFiles: ['src/testing/init-test.ts'],
environment: 'jsdom',
include: ['src/**/*.spec.ts'],
globals: true,
restoreMocks: true,
coverage: {
// you can include other reporters, but 'json-summary' is required, json is recommended
reporter: ['text', 'json-summary', 'json'],
// If you want a coverage reports even if your tests are failing, include the reportOnFailure option
reportOnFailure: true,
},
},
plugins: [
tsconfigPaths(),
swc.vite({
include: /\.[mc]?[jt]sx?$/,
// for git+ package only
exclude: [
/node_modules\/(?!injection-js|@outposts\/injection-js|\.pnpm)/,
/node_modules\/\.pnpm\/(?!injection-js|@outposts\/injection-js)/,
] as any,
tsconfigFile: './tsconfig.spec.json',
}),
],
});