-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathvitest.config.ts
More file actions
39 lines (37 loc) · 1.08 KB
/
vitest.config.ts
File metadata and controls
39 lines (37 loc) · 1.08 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
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import { resolve } from "path";
export default defineConfig({
plugins: [react()],
test: {
environment: "happy-dom",
include: ["src/**/*.{test,spec}.{ts,tsx}"],
globals: true,
onConsoleLog(log, _type) {
// Suppress known noisy logs while allowing useful debugging output
const noisyPatterns = [
// Retry/flakiness logs from test utilities
/retry.*attempt/i,
/retrying/i,
// Settings-related noise during test setup
/failed to.*settings/i,
/settings.*error/i,
// Processor warnings that don't indicate real issues
/processor.*warning/i,
// Known test fixture console outputs (not real errors)
/\[test\]/i,
];
for (const pattern of noisyPatterns) {
if (pattern.test(log)) {
return false;
}
}
// Allow all other console output (including errors) for debugging
},
},
resolve: {
alias: {
"@": resolve(__dirname, "./src"),
},
},
});