mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-18 10:36:07 +00:00
fix(test): drain React scheduler macrotask before jsdom teardown
React 19 defers passive-effect flushes onto a setImmediate callback that reads window.event. When one was still queued as vitest tore down the jsdom environment, it fired after window was deleted and surfaced as an unhandled 'window is not defined' error, failing the run with exit 1 despite all tests passing. Drain the macrotask queue in afterEach so any pending callback runs while window still exists.
This commit is contained in:
@@ -292,7 +292,7 @@ export const InboundSchema = z.object({
|
||||
listen: z.string(),
|
||||
nodeId: z.number().int().nullable().optional(),
|
||||
port: z.number().int().min(1).max(65535),
|
||||
protocol: z.enum(['vmess', 'vless', 'trojan', 'shadowsocks', 'wireguard', 'hysteria', 'http', 'mixed', 'tunnel']),
|
||||
protocol: z.enum(['vmess', 'vless', 'trojan', 'shadowsocks', 'wireguard', 'hysteria', 'http', 'mixed', 'tunnel', 'tun']),
|
||||
remark: z.string(),
|
||||
settings: z.unknown(),
|
||||
sniffing: z.unknown(),
|
||||
|
||||
Reference in New Issue
Block a user