diff --git a/internal/e2e-tests/package.json b/internal/e2e-tests/package.json index 23472ac5e74..d4651fc6d64 100644 --- a/internal/e2e-tests/package.json +++ b/internal/e2e-tests/package.json @@ -13,7 +13,7 @@ "lint": "eslint ." }, "devDependencies": { - "adm-zip": "^0.6.0", - "execa": "^10.0.1" + "execa": "^10.0.1", + "node-stream-zip": "^1.16.0" } } diff --git a/internal/e2e-tests/test/build.js b/internal/e2e-tests/test/build.js index 5659c9c87f0..151b9820cf9 100644 --- a/internal/e2e-tests/test/build.js +++ b/internal/e2e-tests/test/build.js @@ -7,7 +7,9 @@ import {describe, test} from "node:test"; import {fileURLToPath} from "node:url"; import path from "node:path"; import fs from "node:fs/promises"; -import AdmZip from "adm-zip"; +import StreamZip from "node-stream-zip"; + +const AsyncStreamZip = StreamZip.async; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); @@ -91,12 +93,13 @@ describe("ui5 build", () => { assert.ok(zipFileExists, "The zip file should be created in the dist folder"); // Check the archive content - const zip = new AdmZip(zipFilePath); - const zipEntries = zip.getEntries(); + const zip = new AsyncStreamZip({file: zipFilePath}); + const zipEntries = Object.keys(await zip.entries()); + await zip.close(); assert.ok(zipEntries.length > 0, "The zip file should contain entries"); // Check that the zip file contains the expected source file - const testControllerEntry = zipEntries.find((entry) => entry.entryName === "controller/Test.controller.js"); + const testControllerEntry = zipEntries.find((entryName) => entryName === "controller/Test.controller.js"); assert.ok(testControllerEntry, "The zip file should contain the expected source file"); // -------------------------------------------------------------------------------------------- @@ -112,13 +115,14 @@ describe("ui5 build", () => { assert.ok(newZipFileExists, "The zip file should be created in the dist folder after the second build"); // Check the archive content - const zip2 = new AdmZip(zipFilePath); - const zipEntries2 = zip2.getEntries(); + const zip2 = new AsyncStreamZip({file: zipFilePath}); + const zipEntries2 = Object.keys(await zip2.entries()); + await zip2.close(); assert.ok(zipEntries2.length > 0, "The zip file should contain entries after the second build"); // Check that the zip file does NOT contain the expected source file anymore - const deletedTestControllerEntry = zipEntries2.find((entry) => - entry.entryName === "controller/Test.controller.js"); + const deletedTestControllerEntry = zipEntries2.find((entryName) => + entryName === "controller/Test.controller.js"); assert.ok(!deletedTestControllerEntry, "The zip file should NOT contain the deleted source file"); }); diff --git a/package-lock.json b/package-lock.json index a05a3bf1631..42a514c2e9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -85,8 +85,8 @@ "name": "@ui5-internal/e2e-tests", "license": "Apache-2.0", "devDependencies": { - "adm-zip": "^0.6.0", - "execa": "^10.0.1" + "execa": "^10.0.1", + "node-stream-zip": "^1.16.0" }, "engines": { "node": "^22.22.2 || ^24.15.0 || >=26.0.0", @@ -6338,16 +6338,6 @@ "node": ">=0.4.0" } }, - "node_modules/adm-zip": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.6.0.tgz", - "integrity": "sha512-XleryMhbuksdKtofnWZ9Sk+4CUTbms4Mb/EU32SZwToAyZ5RgVos/ki8n+yr0LWHOGKuakbXTuuYNHLQjhddgg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0" - } - }, "node_modules/agent-base": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",