From 6e4a580dff0d7f91fa969a26aa96eaebdb3ec430 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Fri, 13 Nov 2026 17:29:09 -0800 Subject: [PATCH] Use annotations for preparation test controls --- .../hook-service-launch-preparation.test.ts | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/codex/hooks/installation/hook-service-launch-preparation.test.ts b/src/main/codex/hooks/installation/hook-service-launch-preparation.test.ts index e0bb5a4c9fc..584a7b946b7 100644 --- a/src/main/codex/hooks/installation/hook-service-launch-preparation.test.ts +++ b/src/main/codex/hooks/installation/hook-service-launch-preparation.test.ts @@ -16,16 +16,24 @@ import type * as Os from 'node:os' import { join } from 'node:path' import { setupCodexHookHomes } from './hook-service-test-harness' -const { getPathMock, homedirMock, controls } = vi.hoisted(() => ({ - getPathMock: vi.fn<(name: string) => string>(), - homedirMock: vi.fn<() => string>(), - controls: { - aroundMirror: null as null | (() => () => void), - afterCleanup: null as null | (() => void), +const { getPathMock, homedirMock, controls } = vi.hoisted(() => { + const controls: { + aroundMirror: null | (() => () => void) + afterCleanup: null | (() => void) + hideLegacy: boolean + failLegacyDelete: boolean + } = { + aroundMirror: null, + afterCleanup: null, hideLegacy: false, failLegacyDelete: false } -})) + return { + getPathMock: vi.fn<(name: string) => string>(), + homedirMock: vi.fn<() => string>(), + controls + } +}) vi.mock('electron', () => ({ app: { getPath: getPathMock } })) vi.mock('os', async (importOriginal) => ({