Skip to content

Commit 5ddb8a8

Browse files
authored
fix: extend electron-updater mock to include downloadUpdate method (#225)
1 parent dc346d8 commit 5ddb8a8

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

resources/js/electron-plugin/tests/api.test.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
22
import startAPIServer, { APIProcess } from "../src/server/api";
33
import axios from "axios";
44

5-
vi.mock('electron-updater', () => ({
6-
autoUpdater: {
7-
checkForUpdates: vi.fn(),
8-
quitAndInstall: vi.fn(),
9-
addListener: vi.fn(),
10-
},
11-
}));
5+
vi.mock('electron-updater', () => {
6+
return {
7+
default: {
8+
autoUpdater: {
9+
checkForUpdates: vi.fn(),
10+
quitAndInstall: vi.fn(),
11+
addListener: vi.fn(),
12+
downloadUpdate: vi.fn(),
13+
},
14+
},
15+
};
16+
});
1217

1318
let apiServer: APIProcess;
1419

0 commit comments

Comments
 (0)