diff --git a/build/tests/integration/lib/adapterSetup.js b/build/tests/integration/lib/adapterSetup.js index b5c4317..a5069c6 100644 --- a/build/tests/integration/lib/adapterSetup.js +++ b/build/tests/integration/lib/adapterSetup.js @@ -76,6 +76,19 @@ class AdapterSetup { const tarballPath = path.resolve(this.adapterDir, tarballName); await (0, fs_extra_1.copy)(tarballPath, path.resolve(this.testDir, tarballName)); await (0, fs_extra_1.unlink)(tarballPath); + // Let npm remove the adapter in the package-lock.json file(s), + // so that the installation in the following step + // won't grab the cached files. + // See https://github.com/ioBroker/testing/issues/612 + debug("Removing the adapter from package-lock.json"); + await (0, executeCommand_1.executeCommand)("npm", [ + "uninstall", + this.adapterFullName, + "--package-lock-only", + "--omit=dev", + ], { + cwd: this.testDir, + }); // Complete the package.json, so npm can do it's magic debug("Saving the adapter in package.json"); const packageJsonPath = path.join(this.testDir, "package.json"); @@ -93,7 +106,7 @@ class AdapterSetup { await (0, fs_extra_1.remove)(this.testAdapterDir); debug("Installing adapter"); // Defer to npm to install the controller (if it wasn't already) - await (0, executeCommand_1.executeCommand)("npm", ["i", "--production"], { + await (0, executeCommand_1.executeCommand)("npm", ["i", "--omit=dev"], { cwd: this.testDir, }); debug(" => done!"); diff --git a/build/tests/integration/lib/controllerSetup.js b/build/tests/integration/lib/controllerSetup.js index 399b788..be0f953 100644 --- a/build/tests/integration/lib/controllerSetup.js +++ b/build/tests/integration/lib/controllerSetup.js @@ -89,7 +89,7 @@ class ControllerSetup { const wasJsControllerInstalled = await this.isJsControllerInstalled(); // Defer to npm to install the controller (if it wasn't already) debug("(Re-)installing JS Controller..."); - await (0, executeCommand_1.executeCommand)("npm", ["i", "--production"], { + await (0, executeCommand_1.executeCommand)("npm", ["i", "--omit=dev"], { cwd: this.testDir, }); // Prepare/clean the databases and config diff --git a/build/tests/packageFiles/index.js b/build/tests/packageFiles/index.js index 043ae4e..6ade9a8 100644 --- a/build/tests/packageFiles/index.js +++ b/build/tests/packageFiles/index.js @@ -206,11 +206,12 @@ function validatePackageFiles(adapterDir) { iopackContent.common.noConfig === "true" || iopackContent.common.adminUI?.config === "none"; if (!hasNoConfigPage) { - it("The adapter uses Material UI or JSON Config for the admin UI", () => { + it("The adapter uses a supported admin UI", () => { const hasSupportedUI = !!iopackContent.common.materialize || + iopackContent.common.adminUI?.config === "html" || iopackContent.common.adminUI?.config === "json" || iopackContent.common.adminUI?.config === "materialize"; - (0, chai_1.expect)(hasSupportedUI, "Unsupported Admin UI, must be materialize or json config!").to.be.true; + (0, chai_1.expect)(hasSupportedUI, "Unsupported Admin UI, must be html, materialize or JSON config!").to.be.true; }); } }); diff --git a/src/tests/integration/lib/adapterSetup.ts b/src/tests/integration/lib/adapterSetup.ts index 49b99d9..21b8d7a 100644 --- a/src/tests/integration/lib/adapterSetup.ts +++ b/src/tests/integration/lib/adapterSetup.ts @@ -79,6 +79,24 @@ export class AdapterSetup { await copy(tarballPath, path.resolve(this.testDir, tarballName)); await unlink(tarballPath); + // Let npm remove the adapter in the package-lock.json file(s), + // so that the installation in the following step + // won't grab the cached files. + // See https://github.com/ioBroker/testing/issues/612 + debug("Removing the adapter from package-lock.json"); + await executeCommand( + "npm", + [ + "uninstall", + this.adapterFullName, + "--package-lock-only", + "--omit=dev", + ], + { + cwd: this.testDir, + }, + ); + // Complete the package.json, so npm can do it's magic debug("Saving the adapter in package.json"); const packageJsonPath = path.join(this.testDir, "package.json"); @@ -101,7 +119,7 @@ export class AdapterSetup { debug("Installing adapter"); // Defer to npm to install the controller (if it wasn't already) - await executeCommand("npm", ["i", "--production"], { + await executeCommand("npm", ["i", "--omit=dev"], { cwd: this.testDir, }); diff --git a/src/tests/integration/lib/controllerSetup.ts b/src/tests/integration/lib/controllerSetup.ts index 4789a36..adc85ee 100644 --- a/src/tests/integration/lib/controllerSetup.ts +++ b/src/tests/integration/lib/controllerSetup.ts @@ -100,7 +100,7 @@ export class ControllerSetup { const wasJsControllerInstalled = await this.isJsControllerInstalled(); // Defer to npm to install the controller (if it wasn't already) debug("(Re-)installing JS Controller..."); - await executeCommand("npm", ["i", "--production"], { + await executeCommand("npm", ["i", "--omit=dev"], { cwd: this.testDir, }); // Prepare/clean the databases and config