From 2f05f76726d24de4f3da91968f093cbe57e95b69 Mon Sep 17 00:00:00 2001 From: WINBIGFOX Date: Sat, 7 Jun 2025 14:19:14 +0200 Subject: [PATCH] fix: extend electron-updater mock to include downloadUpdate method --- .../js/electron-plugin/tests/api.test.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/resources/js/electron-plugin/tests/api.test.ts b/resources/js/electron-plugin/tests/api.test.ts index ce4959cc..3abe8b85 100644 --- a/resources/js/electron-plugin/tests/api.test.ts +++ b/resources/js/electron-plugin/tests/api.test.ts @@ -2,13 +2,18 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; import startAPIServer, { APIProcess } from "../src/server/api"; import axios from "axios"; -vi.mock('electron-updater', () => ({ - autoUpdater: { - checkForUpdates: vi.fn(), - quitAndInstall: vi.fn(), - addListener: vi.fn(), - }, -})); +vi.mock('electron-updater', () => { + return { + default: { + autoUpdater: { + checkForUpdates: vi.fn(), + quitAndInstall: vi.fn(), + addListener: vi.fn(), + downloadUpdate: vi.fn(), + }, + }, + }; +}); let apiServer: APIProcess;