File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ export default defineConfig({
2424 // "src/**/*.test.ts",
2525 ] ,
2626
27+ // Setup file for E2E tests
28+ setupFiles : [ "./vitest.e2e.setup.ts" ] ,
29+
2730 // Browser testing configuration
2831 browser : {
2932 enabled : true ,
Original file line number Diff line number Diff line change 1+ /**
2+ * Setup file for E2E tests
3+ * Suppresses expected error and debug logs during testing
4+ */
5+
6+ // Suppress expected error logs from error isolation tests
7+ // These tests intentionally throw errors to verify error handling
8+ const originalError = console . error ;
9+
10+ console . error = ( ...args : unknown [ ] ) => {
11+ // Filter out expected error logs from error isolation pattern
12+ const message = args [ 0 ] ;
13+ if (
14+ typeof message === "string" &&
15+ ( message === "[__web_sqlite] Event callback error:" ||
16+ message === "[LogDispatcher] Callback error:" )
17+ ) {
18+ // Suppress these expected error logs during tests
19+ return ;
20+ }
21+ // Pass through other errors
22+ originalError ( ...args ) ;
23+ } ;
24+
25+ // Suppress debug logs during E2E tests
26+ // These are for development troubleshooting but clutter test output
27+ const _originalDebug = console . debug ;
28+
29+ console . debug = ( ..._args : unknown [ ] ) => {
30+ // Suppress all console.debug output during tests
31+ // Uncomment to enable debug logs when troubleshooting:
32+ // _originalDebug(..._args);
33+ } ;
Original file line number Diff line number Diff line change 88if ( typeof global . window === "undefined" ) {
99 global . window = { } as unknown as Window & typeof globalThis ;
1010}
11+
12+ // Suppress expected error logs from error isolation tests
13+ // These tests intentionally throw errors to verify error handling
14+ const originalError = console . error ;
15+
16+ console . error = ( ...args : unknown [ ] ) => {
17+ // Filter out expected error logs from error isolation pattern
18+ const message = args [ 0 ] ;
19+ if (
20+ typeof message === "string" &&
21+ ( message === "[__web_sqlite] Event callback error:" ||
22+ message === "[LogDispatcher] Callback error:" )
23+ ) {
24+ // Suppress these expected error logs during tests
25+ return ;
26+ }
27+ // Pass through other errors
28+ originalError ( ...args ) ;
29+ } ;
You can’t perform that action at this time.
0 commit comments