forked from adoptium/adoptium.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
40 lines (40 loc) · 841 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
34
35
36
37
38
39
40
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [
react(),
{
name: 'load-svg',
enforce: 'pre',
transform (_, id) {
if (id.endsWith('.svg')) {
return 'export default \'img\''
}
}
}
],
test: {
globals: true,
setupFiles: './vitest-setup.ts',
environment: 'jsdom',
deps: {
// >= 0.34
optimizer: {
web: {
include: ['vitest-canvas-mock']
}
}
},
coverage: {
all: true,
include: ['src/**/*.{ts,tsx}'],
exclude: ['src/types/**', 'src/**/__tests__/**', 'src/**/__mocks__/**'],
reporter: ['text', 'json', 'html']
},
environmentOptions: {
jsdom: {
resources: 'usable',
},
},
}
})