-
Notifications
You must be signed in to change notification settings - Fork 286
Expand file tree
/
Copy pathvitest.config.ts
More file actions
59 lines (58 loc) · 1.54 KB
/
vitest.config.ts
File metadata and controls
59 lines (58 loc) · 1.54 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
47
48
49
50
51
52
53
54
55
56
57
58
59
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [react()],
test: {
globals: true,
pool: 'vmThreads',
clearMocks: true,
// Pre-bundle @primer/react rather than re-transforming the raw package on every thread load.
// See https://vitest.dev/guide/profiling-test-performance.html#use-the-dependency-optimizer
deps: {
optimizer: {
client: {
include: ['@primer/react'],
},
},
},
experimental: {
importDurations: {
print: true,
},
},
coverage: {
enabled: false,
reportOnFailure: true,
reporter: ['html', 'lcovonly'],
include: ['src/**/*'],
exclude: ['**/*.html', '**/*.graphql', '**/graphql/generated/**'],
},
projects: [
{
extends: true,
test: {
name: 'happy-dom [preload, renderer]',
environment: 'happy-dom',
css: true,
include: [
'src/preload/**/*.test.{ts,tsx}',
'src/renderer/**/*.test.{ts,tsx}',
],
setupFiles: ['./src/renderer/__helpers__/vitest.setup.ts'],
},
},
{
// TODO - Opportunity in future to move some of the renderer util tests to node environment
extends: true,
test: {
name: 'node [main, shared]',
environment: 'node',
include: [
'src/shared/**/*.test.{ts,tsx}',
'src/main/**/*.test.{ts,tsx}',
],
},
},
],
},
});