-
Notifications
You must be signed in to change notification settings - Fork 131
/
Copy pathvitest.config.mts
48 lines (47 loc) · 1.25 KB
/
vitest.config.mts
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
44
45
46
47
48
/* eslint-disable import/no-extraneous-dependencies */
import react from '@vitejs/plugin-react'
import svg from 'vite-plugin-magical-svg'
import { defineConfig } from 'vitest/config'
export default defineConfig({
plugins: [
svg({ target: 'react' }),
react(),
{
name: 'jsdom-cleanup',
config: () => ({
test: {
include: ['src/**/*.test.tsx'],
setupFiles: ['./test/dom-setup.mts'],
},
}),
},
],
test: {
globals: false,
environment: 'jsdom',
alias: {
/* eslint-disable @typescript-eslint/naming-convention */
'@app/': new URL('./src/', import.meta.url).pathname,
'@root/': new URL('./', import.meta.url).pathname,
/* eslint-enable @typescript-eslint/naming-convention */
},
include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
setupFiles: ['./test/textencoder-setup.mts', './test/websocket-setup.mts'],
globalSetup: ['./test/global-setup.mts'],
coverage: {
provider: 'v8',
include: ['src/**/*'],
},
typecheck: {
ignoreSourceErrors: true,
},
environmentMatchGlobs: [['**/*.node.test.ts', 'node']],
deps: {
optimizer: {
web: {
include: ['vitest-canvas-mock'],
},
},
},
},
})