test(e2e): harden fixture preflight and remove duplicate generation

This commit is contained in:
kl
2026-03-04 13:16:14 +08:00
parent 3b0f7af382
commit 30127aae7c
3 changed files with 24 additions and 12 deletions

View File

@@ -24,8 +24,9 @@ if (!fs.existsSync(zipPath)) {
fs.writeFileSync(path.join(zipWork, 'inner.txt'), 'kkFileView zip inner file');
try {
execFileSync('zip', ['-X', '-q', '-r', zipPath, 'inner.txt'], { cwd: zipWork });
} catch {
// fallback: keep going if zip is not available locally
} catch (err) {
console.error('Failed to create sample.zip fixture. Ensure "zip" is installed and available in PATH.');
throw err instanceof Error ? err : new Error(String(err));
}
}