-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.e2e.setup.ts
More file actions
33 lines (29 loc) · 1021 Bytes
/
vitest.e2e.setup.ts
File metadata and controls
33 lines (29 loc) · 1021 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
31
32
33
/**
* Setup file for E2E tests
* Suppresses expected error and debug logs during testing
*/
// Suppress expected error logs from error isolation tests
// These tests intentionally throw errors to verify error handling
const originalError = console.error;
console.error = (...args: unknown[]) => {
// Filter out expected error logs from error isolation pattern
const message = args[0];
if (
typeof message === "string" &&
(message === "[__web_sqlite] Event callback error:" ||
message === "[LogDispatcher] Callback error:")
) {
// Suppress these expected error logs during tests
return;
}
// Pass through other errors
originalError(...args);
};
// Suppress debug logs during E2E tests
// These are for development troubleshooting but clutter test output
const _originalDebug = console.debug;
console.debug = (..._args: unknown[]) => {
// Suppress all console.debug output during tests
// Uncomment to enable debug logs when troubleshooting:
// _originalDebug(..._args);
};