-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvitest.config.base.mjs
More file actions
39 lines (38 loc) · 1.27 KB
/
vitest.config.base.mjs
File metadata and controls
39 lines (38 loc) · 1.27 KB
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
import { resolve } from 'node:path';
import { defineConfig } from 'vitest/config';
// More information about mode: https://vite.dev/guide/env-and-mode.html#node-env-and-modes
export const viteBaseConfig = defineConfig(({ command, mode }) => {
return {
test: {
globals: true,
watch: false,
environment: 'node',
reporters: ['default'],
coverage: {
provider: 'v8',
exclude: [
'node_modules/',
'**/types',
'*.mjs',
'**/__data__',
'**/dist',
'**/out-tsc',
],
thresholds: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
include: [
'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
'tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
],
setupFiles: [
// Include the root setup file in all tests that extend this config
resolve(import.meta.dirname, './vite.global.setup.mjs'),
],
},
};
});