mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-03-14 05:03:49 +08:00
test(e2e): harden fixture preflight and remove duplicate generation
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user