koel/resources/assets/js/__tests__/setup.ts
2022-07-22 18:59:28 +02:00

15 lines
458 B
TypeScript

import vueSnapshotSerializer from 'jest-serializer-vue'
import { expect, vi } from 'vitest'
expect.addSnapshotSerializer(vueSnapshotSerializer)
global.ResizeObserver = global.ResizeObserver ||
vi.fn().mockImplementation(() => ({
disconnect: vi.fn(),
observe: vi.fn(),
unobserve: vi.fn()
}))
window.HTMLMediaElement.prototype.load = vi.fn()
window.HTMLMediaElement.prototype.play = vi.fn()
window.HTMLMediaElement.prototype.pause = vi.fn()