From 4d8f201d22afd7ee956d4f23109ae97dbc5626aa Mon Sep 17 00:00:00 2001 From: tommy0103 Date: Thu, 16 Jul 2026 21:25:05 +0800 Subject: [PATCH] test(cli): launch npm through shell on Windows --- tests/cli-package.test.mjs | 9 ++++++++- tests/skill-doc-artifact.test.mjs | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/cli-package.test.mjs b/tests/cli-package.test.mjs index 75d5549..bbe09e0 100644 --- a/tests/cli-package.test.mjs +++ b/tests/cli-package.test.mjs @@ -110,6 +110,7 @@ test('npm pack installs one platform-neutral CLI with its schema resource', () = cwd: repoRoot, env: npmEnv, encoding: 'utf8', + shell: process.platform === 'win32', stdio: ['ignore', 'pipe', 'pipe'], }, )); @@ -123,7 +124,13 @@ test('npm pack installs one platform-neutral CLI with its schema resource', () = execFileSync( npmCommand, ['install', '--global', '--prefix', prefix, tarball, '--ignore-scripts'], - { cwd: repoRoot, env: npmEnv, encoding: 'utf8', stdio: 'pipe' }, + { + cwd: repoRoot, + env: npmEnv, + encoding: 'utf8', + shell: process.platform === 'win32', + stdio: 'pipe', + }, ); const installedBin = process.platform === 'win32' diff --git a/tests/skill-doc-artifact.test.mjs b/tests/skill-doc-artifact.test.mjs index fb06da0..e49c6ad 100644 --- a/tests/skill-doc-artifact.test.mjs +++ b/tests/skill-doc-artifact.test.mjs @@ -13,6 +13,7 @@ test('build:skill produces a docs-only skill that delegates execution to the CLI execFileSync(npmCommand, ['run', 'build:skill'], { cwd: repoRoot, encoding: 'utf8', + shell: process.platform === 'win32', stdio: 'pipe', });