2026-03-29 04:41:38 +07:00

14 lines
451 B
TypeScript

import "@testing-library/jest-dom";
// jsdom does not implement PointerEvent — polyfill it for tests that need it
if (typeof PointerEvent === "undefined") {
class PointerEvent extends MouseEvent {
pointerId?: number;
constructor(type: string, params: PointerEventInit = {}) {
super(type, params);
this.pointerId = params.pointerId;
}
}
(globalThis as unknown as Record<string, unknown>).PointerEvent = PointerEvent;
}