-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathvitest.unit.config.ts
More file actions
32 lines (30 loc) · 903 Bytes
/
vitest.unit.config.ts
File metadata and controls
32 lines (30 loc) · 903 Bytes
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 path from 'path';
import { readFileSync } from 'node:fs';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';
const packageJson = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')) as {
version?: string;
};
export default defineConfig({
plugins: [react()],
define: {
__APP_VERSION__: JSON.stringify(packageJson.version ?? '0.0.0'),
},
test: {
name: 'unit',
environment: 'jsdom',
globals: true,
setupFiles: ['./src/setupTests.ts'],
coverage: {
provider: 'v8',
include: ['src/app/**/*.{ts,tsx}'],
exclude: ['src/app/**/*.d.ts', 'src/app/**/index.ts', '**/*.json', '**/package.json'],
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'virtual:pwa-register': path.resolve(__dirname, './src/test/mocks/virtual-pwa-register.ts'),
},
},
});