Files
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

15 lines
561 B
TypeScript

/**
* Shared test setup. jsdom does not implement ResizeObserver, which the v1
* SlideCanvas depends on via `useViewportSize`; provide a no-op polyfill so
* component tests that mount SlideCanvas (e.g. EditableSlideCanvas) can render.
* Harmless under the node environment used by the pure-core tests.
*/
if (typeof globalThis.ResizeObserver === 'undefined') {
class ResizeObserverStub {
observe(): void {}
unobserve(): void {}
disconnect(): void {}
}
globalThis.ResizeObserver = ResizeObserverStub as unknown as typeof ResizeObserver;
}