test(cli): launch npm through shell on Windows

This commit is contained in:
tommy0103
2026-07-16 21:25:05 +08:00
parent 5da5987bee
commit 4d8f201d22
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -110,6 +110,7 @@ test('npm pack installs one platform-neutral CLI with its schema resource', () =
cwd: repoRoot, cwd: repoRoot,
env: npmEnv, env: npmEnv,
encoding: 'utf8', encoding: 'utf8',
shell: process.platform === 'win32',
stdio: ['ignore', 'pipe', 'pipe'], stdio: ['ignore', 'pipe', 'pipe'],
}, },
)); ));
@@ -123,7 +124,13 @@ test('npm pack installs one platform-neutral CLI with its schema resource', () =
execFileSync( execFileSync(
npmCommand, npmCommand,
['install', '--global', '--prefix', prefix, tarball, '--ignore-scripts'], ['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' const installedBin = process.platform === 'win32'
+1
View File
@@ -13,6 +13,7 @@ test('build:skill produces a docs-only skill that delegates execution to the CLI
execFileSync(npmCommand, ['run', 'build:skill'], { execFileSync(npmCommand, ['run', 'build:skill'], {
cwd: repoRoot, cwd: repoRoot,
encoding: 'utf8', encoding: 'utf8',
shell: process.platform === 'win32',
stdio: 'pipe', stdio: 'pipe',
}); });