Skip to content

Commit

Permalink
refactor: call mockName on outerMock
Browse files Browse the repository at this point in the history
  • Loading branch information
goosewobbler committed Feb 9, 2024
1 parent c380406 commit 3fe917a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ async function restoreElectronFunctionality(apiName: string, funcName: string) {

export async function createMock(apiName: string, funcName: string) {
const outerMock = vitestFn();
const mock = outerMock as unknown as ElectronMock;
const outerMockImplementation = outerMock.mockImplementation;
const outerMockImplementationOnce = outerMock.mockImplementationOnce;
const outerMockClear = outerMock.mockClear;
const outerMockReset = outerMock.mockReset;

mock.mockName(`electron.${apiName}.${funcName}`);
outerMock.mockName(`electron.${apiName}.${funcName}`);

const mock = outerMock as unknown as ElectronMock;

// initialise inner (Electron) mock
await browser.electron.execute<void, [string, string, ExecuteOpts]>(
Expand Down

0 comments on commit 3fe917a

Please sign in to comment.