fix(tests): Mock MessageChannel to prevent Jest hanging from rc-overflow (#34871)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Joe Li
2025-08-27 22:50:08 -07:00
committed by GitHub
parent b558b34faf
commit 836540e8c9
3 changed files with 28 additions and 0 deletions

View File

@@ -31,5 +31,12 @@ export default class FixJSDOMEnvironment extends JSDOMEnvironment {
this.global.Response = Response;
this.global.AbortSignal = AbortSignal;
this.global.AbortController = AbortController;
// Mock MessageChannel to prevent hanging Jest tests with rc-overflow@1.4.1
// Forces rc-overflow to use requestAnimationFrame fallback instead
// Can be removed when rc-overflow properly cleans up MessagePorts in test environments
// See: https://github.com/apache/superset/pull/34871
delete (this.global as any).MessageChannel;
delete (this.global as any).MessagePort;
}
}