From eba92e23a1103cf545a6c578403d68089cc58976 Mon Sep 17 00:00:00 2001 From: riyad Date: Sun, 20 Oct 2024 16:01:34 +0600 Subject: [PATCH] fix: mock load added to test.tsx --- tests/common.test.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/common.test.tsx b/tests/common.test.tsx index 6b60986..4199d81 100644 --- a/tests/common.test.tsx +++ b/tests/common.test.tsx @@ -5,6 +5,13 @@ import 'jest-canvas-mock'; import { AudioPlayer } from '../src'; +beforeAll(() => { + Object.defineProperty(HTMLMediaElement.prototype, 'load', { + configurable: true, + value: jest.fn() // Mock implementation of the load method + }); +}); + describe('Common render', () => { it('renders without crashing', () => { render();