From b71b6adb11ec95112d8c5c2c5b7c6fb311ec9d98 Mon Sep 17 00:00:00 2001 From: HeversonSilva-gif Date: Mon, 3 Aug 2026 11:06:26 -0300 Subject: [PATCH] fix(tests): invoke the CLI without npx so the suite runs on Windows --- src/__tests__/invoke-cli.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/__tests__/invoke-cli.ts b/src/__tests__/invoke-cli.ts index cf7cac4..dc2954c 100644 --- a/src/__tests__/invoke-cli.ts +++ b/src/__tests__/invoke-cli.ts @@ -24,8 +24,10 @@ export interface CliResult { */ export function invokeCli(args: string[]): CliResult { try { - // Use execFileSync with array args to prevent shell injection - const stdout = execFileSync('npx', ['tsx', CLI_PATH, ...args], { + // Use execFileSync with array args to prevent shell injection. + // Run node directly with tsx as a loader rather than going through npx: on Windows + // npx is a .cmd shim, which execFileSync cannot launch without a shell. + const stdout = execFileSync(process.execPath, ['--import', 'tsx', CLI_PATH, ...args], { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], });