fix: use generic Error type in setup.ts to avoid NodeJS namespace

This commit is contained in:
Test
2026-03-04 11:19:03 +01:00
parent 008f067bf7
commit db47ffe454

View File

@@ -3,7 +3,8 @@ import { vi } from 'vitest'
import { createElement, type ReactNode, type ComponentType } from 'react'
// Suppress undici WebSocket ERR_INVALID_ARG_TYPE in jsdom (jsdom Event ≠ Node Event)
process.on('uncaughtException', (err: NodeJS.ErrnoException) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
;(globalThis as any).process?.on?.('uncaughtException', (err: Error & { code?: string }) => {
if (err.code === 'ERR_INVALID_ARG_TYPE' && err.message?.includes('Event')) return
throw err
})