jsdom-testing-mocks
Version:
A set of tools for emulating browser behavior in jsdom environment
20 lines (17 loc) • 457 B
text/typescript
class MockedAnimationPlaybackEvent
extends Event
implements AnimationPlaybackEvent
{
readonly currentTime = null;
readonly timelineTime = null;
}
function mockAnimationPlaybackEvent() {
if (typeof AnimationPlaybackEvent === 'undefined') {
Object.defineProperty(window, 'AnimationPlaybackEvent', {
writable: true,
configurable: true,
value: MockedAnimationPlaybackEvent,
});
}
}
export { mockAnimationPlaybackEvent };