@iobroker/testing
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -10,2 +10,7 @@ /// <reference types="iobroker" /> | ||
waitBeforeStartupSuccess?: number; | ||
/** | ||
* Which JS-Controller version or dist-tag should be used for the tests. Default: dev | ||
* This should only be changed during active development. | ||
*/ | ||
controllerVersion?: string; | ||
/** Allows you to define additional tests */ | ||
@@ -12,0 +17,0 @@ defineAdditionalTests?: (args: TestContext) => void; |
@@ -61,3 +61,3 @@ "use strict"; | ||
// First we need to copy all files and execute an npm install | ||
await controllerSetup.prepareTestDir(); | ||
await controllerSetup.prepareTestDir(options.controllerVersion); | ||
// Only then we can install the adapter, because some (including VIS) try to access | ||
@@ -64,0 +64,0 @@ // the databases if JS Controller is installed |
@@ -11,3 +11,3 @@ import type { DBConnection } from "./dbConnection"; | ||
private testDataDir; | ||
prepareTestDir(): Promise<void>; | ||
prepareTestDir(controllerVersion?: string): Promise<void>; | ||
/** | ||
@@ -14,0 +14,0 @@ * Tests if JS-Controller is already installed |
@@ -56,4 +56,4 @@ "use strict"; | ||
} | ||
async prepareTestDir() { | ||
debug("Preparing the test directory..."); | ||
async prepareTestDir(controllerVersion = "dev") { | ||
debug(`Preparing the test directory. JS-Controller version: "${controllerVersion}"...`); | ||
// Make sure the test dir exists | ||
@@ -73,3 +73,3 @@ await (0, fs_extra_1.ensureDir)(this.testDir); | ||
dependencies: { | ||
[`${this.appName}.js-controller`]: "dev", | ||
[`${this.appName}.js-controller`]: controllerVersion, | ||
}, | ||
@@ -76,0 +76,0 @@ description: "", |
{ | ||
"name": "@iobroker/testing", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "Shared utilities for adapter and module testing in ioBroker", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -46,2 +46,6 @@ # @iobroker/testing | ||
// To test against a different version of JS-Controller, you can change the version or dist-tag here. | ||
// Make sure to remove this setting when you're done testing. | ||
controllerVersion: "latest", // or a specific version like "4.0.1" | ||
// Define your own tests inside defineAdditionalTests | ||
@@ -48,0 +52,0 @@ defineAdditionalTests({ suite }) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
144022
3208
206