chore: Compatible with Windows local run visual regression (#53702)

This commit is contained in:
Wanpan 2025-04-30 09:39:37 +08:00 committed by GitHub
parent e4ff13efb5
commit 4d257551f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,6 +109,9 @@ async function getOssBranchHash(branch: string) {
}
function runImageTests(args: string[]) {
// Windows 环境下特殊处理
const isWindows = process.platform === 'win32';
const { command, args: realArgs } = resolveCommand(packageManager!, 'run', args)!;
spawnSync(command, realArgs, {
stdio: 'inherit',
@ -116,6 +119,7 @@ function runImageTests(args: string[]) {
...process.env,
LOCAL: 'true', // 总是本地运行
},
shell: isWindows, // Windows 下使用 shell 执行
});
}
@ -251,6 +255,11 @@ async function run() {
}
}
/**
*
*
* npx puppeteer browsers install chrome
*/
run().catch((e) => {
console.error(e);
process.exit(1);