-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
78 lines (76 loc) · 2.64 KB
/
Copy pathvite.config.js
File metadata and controls
78 lines (76 loc) · 2.64 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
base: './',
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
build: {
outDir: 'dist',
assetsDir: 'assets',
emptyOutDir: true,
rollupOptions: {
output: {
manualChunks(id) {
const vendorModules = ['react', 'react-dom', 'react-router-dom'];
const uiModules = [
'@radix-ui/react-dialog',
'@radix-ui/react-dropdown-menu',
'@radix-ui/react-tabs',
];
if (vendorModules.some((m) => id.includes(`/node_modules/${m}/`))) {
return 'vendor';
}
if (uiModules.some((m) => id.includes(`/node_modules/${m}/`))) {
return 'ui';
}
},
},
},
},
server: {
port: 5173,
strictPort: true,
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./tests/setup-react.js'],
include: ['tests/components/**/*.test.{js,jsx}'],
css: true,
coverage: {
provider: 'v8',
reporter: ['text', 'text-summary', 'lcov', 'json-summary'],
reportsDirectory: './coverage',
include: ['src/**/*.{js,jsx}'],
exclude: [
'src/components/ui/**',
'src/main.jsx',
// IPC-bound integration pages — exercised by the Playwright e2e job
// rather than by JSDom component tests.
'src/pages/AccountSecurity.jsx',
'src/pages/OrganOffers.jsx',
'src/pages/PostTransplant.jsx',
'src/pages/LivingDonors.jsx',
'src/pages/Hl7Inbox.jsx',
],
// Per-file coverage gates for PHI-touching screens. These five
// components ingest patient, donor, lab, AHHQ, or barrier data
// and therefore are the most regression-sensitive UI paths.
// The 60% lines threshold is the production-readiness bar
// captured in the project evaluation report (see commit log).
thresholds: {
'src/components/patients/PatientForm.jsx': { lines: 60, statements: 60, branches: 60, functions: 35 },
'src/components/donor/DonorForm.jsx': { lines: 60, statements: 60, branches: 60, functions: 50 },
'src/components/barriers/ReadinessBarrierForm.jsx': { lines: 60, statements: 60, branches: 60, functions: 60 },
'src/components/labs/LabForm.jsx': { lines: 60, statements: 60, branches: 60, functions: 60 },
'src/components/ahhq/AHHQForm.jsx': { lines: 60, statements: 60, branches: 60, functions: 60 },
},
},
},
});