From d98910b77c2674d854b6ce3893747d96a44cdb11 Mon Sep 17 00:00:00 2001 From: "A.K.M. Adib" Date: Mon, 4 May 2026 16:29:17 -0400 Subject: [PATCH] test(cli): use platform-aware editor command in editorUtils tests --- packages/cli/src/ui/utils/editorUtils.test.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/ui/utils/editorUtils.test.ts b/packages/cli/src/ui/utils/editorUtils.test.ts index 2aa58affcc..17d2fa2ef8 100644 --- a/packages/cli/src/ui/utils/editorUtils.test.ts +++ b/packages/cli/src/ui/utils/editorUtils.test.ts @@ -12,7 +12,11 @@ import { type SpawnSyncReturns, type ChildProcess, } from 'node:child_process'; -import { CoreEvent, coreEvents } from '@google/gemini-cli-core'; +import { + CoreEvent, + coreEvents, + getEditorCommand, +} from '@google/gemini-cli-core'; vi.mock('node:child_process', () => ({ spawnSync: vi.fn(), @@ -54,7 +58,7 @@ describe('editorUtils', () => { } as SpawnSyncReturns); await openFileInEditor('test.txt', null, undefined, 'vim'); expect(spawnSync).toHaveBeenCalledWith( - 'vim', + getEditorCommand('vim'), expect.arrayContaining(['test.txt']), expect.anything(), ); @@ -73,7 +77,7 @@ describe('editorUtils', () => { vi.mocked(spawn).mockReturnValue(mockChild as unknown as ChildProcess); await openFileInEditor('test.txt', null, undefined, 'vscode'); expect(spawn).toHaveBeenCalledWith( - 'code', + getEditorCommand('vscode'), expect.arrayContaining(['--wait', 'test.txt']), expect.anything(), );