Skip to content

Commit 2161db4

Browse files
committed
improvements for CI
1 parent df29031 commit 2161db4

3 files changed

Lines changed: 35 additions & 3 deletions

File tree

e2e/helpers.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { execSync } from 'child_process';
33
import * as fs from 'fs';
44
import * as path from 'path';
55
import * as os from 'os';
6+
import AdmZip from 'adm-zip';
67

78
// Get absolute path to rememory binary
89
export function getRememoryBin(): string {
@@ -34,11 +35,18 @@ export function createTestProject(): string {
3435
}
3536

3637
// Extract a bundle ZIP and return the extracted directory path
38+
// Note: friendName is case-insensitive, bundle files are lowercase
3739
export function extractBundle(bundlesDir: string, friendName: string): string {
38-
const bundleZip = path.join(bundlesDir, `bundle-${friendName}.zip`);
39-
const extractDir = path.join(bundlesDir, `bundle-${friendName}`);
40+
const lowerName = friendName.toLowerCase();
41+
const bundleZip = path.join(bundlesDir, `bundle-${lowerName}.zip`);
42+
const extractDir = path.join(bundlesDir, `bundle-${lowerName}`);
43+
4044
fs.mkdirSync(extractDir, { recursive: true });
41-
execSync(`unzip -o "${bundleZip}" -d "${extractDir}"`, { stdio: 'ignore' });
45+
46+
// Use adm-zip for cross-platform extraction
47+
const zip = new AdmZip(bundleZip);
48+
zip.extractAllTo(extractDir, true);
49+
4250
return extractDir;
4351
}
4452

package-lock.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"devDependencies": {
1111
"@playwright/test": "^1.40.0",
1212
"@types/node": "^20.10.0",
13+
"adm-zip": "^0.5.10",
14+
"@types/adm-zip": "^0.5.5",
1315
"typescript": "^5.3.0"
1416
}
1517
}

0 commit comments

Comments
 (0)