Skip to content

Commit 7756445

Browse files
committed
suppress solid warnigns
1 parent 6b7677d commit 7756445

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/solid-router/tests/setupTests.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,26 @@ global.IS_REACT_ACT_ENVIRONMENT = true
66

77
// Mock window.scrollTo to silence errors in tests
88
window.scrollTo = vi.fn()
9+
10+
// Suppress unhandled rejection warnings for stale value errors during async transitions
11+
process.on('unhandledRejection', (reason: any) => {
12+
const message = reason?.message || reason?.toString() || ''
13+
14+
// Suppress Solid's "stale value" warning
15+
if (message.includes('Attempting to access a stale value from <Match>')) {
16+
return
17+
}
18+
19+
// Suppress useMatch invariant errors during async transition cleanup
20+
if (
21+
message.includes('Could not find an active match from') ||
22+
message.includes('Could not find a match') ||
23+
message.includes('Could not find match for matchId') ||
24+
message.includes('Could not find parent match for matchId')
25+
) {
26+
return
27+
}
28+
29+
// Re-throw other unhandled rejections
30+
throw reason
31+
})

0 commit comments

Comments
 (0)