-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathvitest.config.ts
More file actions
42 lines (41 loc) · 1.17 KB
/
vitest.config.ts
File metadata and controls
42 lines (41 loc) · 1.17 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
40
41
42
import react from '@vitejs/plugin-react'
import path from 'path'
import tsconfigPaths from 'vite-tsconfig-paths'
import { defineConfig } from 'vitest/config'
import { resolveLanguagesSlice } from './vite/language-env'
export default defineConfig({
plugins: [react(), tsconfigPaths()],
define: {
'import.meta.env.LANGUAGES': JSON.stringify(resolveLanguagesSlice(process.env.LANGUAGES)),
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './vitest.setup.ts',
css: true,
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'vitest.setup.ts',
'src/test-utils.tsx',
'**/*.test.{ts,tsx}',
'**/*.spec.{ts,tsx}',
'**/types/**',
],
},
server: {
deps: {
inline: ['@plausible-analytics/tracker', 'react-gtm-module'],
},
},
},
resolve: {
alias: {
// Mock problematic packages for testing
'@plausible-analytics/tracker': path.resolve(__dirname, './src/__mocks__/@plausible-analytics/tracker.ts'),
'react-gtm-module': path.resolve(__dirname, './src/__mocks__/react-gtm-module.ts'),
},
},
})