-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvitest.config.ts
More file actions
46 lines (44 loc) · 1.12 KB
/
vitest.config.ts
File metadata and controls
46 lines (44 loc) · 1.12 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
43
44
45
46
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';
const __dirname = dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [react()],
test: {
globals: true,
reporters: process.env.CI ? ['default', 'junit'] : ['default'],
outputFile: {
junit: 'test-results/junit.xml',
},
projects: [
{
plugins: [react()],
test: {
name: 'renderer',
globals: true,
environment: 'jsdom',
setupFiles: ['./src/renderer/vitest.setup.ts'],
include: ['src/renderer/**/*.test.{ts,tsx}'],
},
resolve: {
alias: { '@': resolve(__dirname, 'src') },
},
},
{
test: {
name: 'main',
globals: true,
environment: 'node',
include: ['src/main/**/*.test.ts'],
},
resolve: {
alias: { '@': resolve(__dirname, 'src') },
},
},
],
},
resolve: {
alias: { '@': resolve(__dirname, 'src') },
},
});