-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.js
More file actions
30 lines (28 loc) · 784 Bytes
/
vitest.config.js
File metadata and controls
30 lines (28 loc) · 784 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
// Coverage thresholds for CI — fail the build if coverage drops below these.
import { defineConfig } from 'vitest/config';
// Vite's built-in shebang stripping doesn't handle \r\n (Windows line endings).
// dashboard-tui.js has a shebang and CRLF, causing "Invalid or unexpected token".
function stripShebang() {
return {
name: 'strip-shebang',
transform(code, id) {
if (code.startsWith('#!')) {
return code.replace(/^#!.*\r?\n/, '');
}
},
};
}
export default defineConfig({
plugins: [stripShebang()],
test: {
coverage: {
include: ['src/**'],
exclude: ['src/dashboard-standalone.js', 'src/dashboard-tui.js'],
thresholds: {
statements: 90,
branches: 80,
functions: 80,
},
},
},
});