@iobroker/legacy-testing 0.3.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +9 -0
  2. package/package.json +3 -3
  3. package/setup.js +7 -2
package/README.md CHANGED
@@ -9,8 +9,17 @@ Legacy test modules for ioBroker
9
9
  3. Replace in `tests/testAdapter.js` the code `const setup = require('./lib/setup');` with `const setup = require('@iobroker/legacy-testing');`
10
10
  4. Replace whole file `tests/testPackageFiles.js` with `require('@iobroker/legacy-testing/tests/testPackageFiles');`
11
11
 
12
+ ## Usage of the specific js-controller version
13
+ Set process.env.JS_CONTROLLER_VERSION to version e.g. `5.0.5-alpha.0-20230617-464b0fd6`
14
+
12
15
  ## Changelog
13
16
  <!-- ### **WORK IN PROGRESS** -->
17
+ ### 1.0.0 (2023-09-18)
18
+ * (bluefox) Corrected error if systemConfig requested
19
+
20
+ ### 0.3.7 (2023-07-07)
21
+ * (bluefox) Allowed using the specific version of js-controller
22
+
14
23
  ### 0.3.6 (2023-05-08)
15
24
  * (bluefox) Added possibility to install additional adapters at start
16
25
  * (bluefox) Added setOfflineState/getOfflineState
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.6",
2
+ "version": "1.0.0",
3
3
  "name": "@iobroker/legacy-testing",
4
4
  "main": "setup.js",
5
5
  "files": [
@@ -25,10 +25,10 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "mocha": "^10.2.0",
28
- "chai": "^4.3.7"
28
+ "chai": "^4.3.8"
29
29
  },
30
30
  "devDependencies": {
31
- "@alcalzone/release-script": "^3.5.9",
31
+ "@alcalzone/release-script": "^3.6.0",
32
32
  "@alcalzone/release-script-plugin-license": "^3.5.9"
33
33
  },
34
34
  "scripts": {
package/setup.js CHANGED
@@ -394,7 +394,7 @@ async function installJsController(preInstalledAdapters, cb) {
394
394
  if (!fs.existsSync(`${rootDir}tmp/node_modules/${appName}.js-controller`)) {
395
395
  console.log('installJsController: no js-controller => install dev build from npm');
396
396
 
397
- cp.execSync(`npm install ${appName}.js-controller@dev --prefix ./ --production`, {
397
+ cp.execSync(`npm install ${appName}.js-controller@${process.env.JS_CONTROLLER_VERSION || 'dev'} --prefix ./ --production`, {
398
398
  cwd: `${rootDir}tmp/`,
399
399
  stdio: [0, 1, 2],
400
400
  });
@@ -423,7 +423,7 @@ async function installJsController(preInstalledAdapters, cb) {
423
423
  if (fs.existsSync(`${rootDir}node_modules/${appName}.js-controller/${appName}.js`)) {
424
424
  _pid = cp.fork(`${appName}.js`, ['stop'], {
425
425
  cwd: `${rootDir}node_modules/${appName}.js-controller`,
426
- stdio: [0, 1, 2, 'ipc']
426
+ stdio: [0, 1, 2, 'ipc'],
427
427
  });
428
428
  }
429
429
 
@@ -543,6 +543,11 @@ function clearDB() {
543
543
  }
544
544
 
545
545
  function setupController(preInstalledAdapters, cb) {
546
+ if (typeof preInstalledAdapters === 'function') {
547
+ cb = preInstalledAdapters;
548
+ preInstalledAdapters = null;
549
+ }
550
+
546
551
  installJsController(preInstalledAdapters, async isInitialized => {
547
552
  try {
548
553
  clearControllerLog();