import { vi } from 'vitest'; Object.defineProperty(HTMLMediaElement.prototype, 'load', { configurable: true, value: vi.fn() }); Object.defineProperty(HTMLMediaElement.prototype, 'play', { configurable: true, value: vi.fn(function (this: HTMLMediaElement) { this.dispatchEvent(new Event('play')); this.dispatchEvent(new Event('playing')); return Promise.resolve(); }) }); Object.defineProperty(HTMLMediaElement.prototype, 'pause', { configurable: true, value: vi.fn(function (this: HTMLMediaElement) { this.dispatchEvent(new Event('pause')); }) });