@iobroker/legacy-testing 3.0.1 → 4.0.1
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.
- package/README.md +7 -0
- package/build/setup.d.ts +1 -0
- package/build/setup.js +16 -22
- package/package.json +12 -9
package/README.md
CHANGED
|
@@ -23,6 +23,13 @@ The variable is ignored if the admin itself is the adapter under test.
|
|
|
23
23
|
|
|
24
24
|
<!-- ### **WORK IN PROGRESS** -->
|
|
25
25
|
## Changelog
|
|
26
|
+
### 4.0.1 (2026-10-15)
|
|
27
|
+
- (@GermanBluefox) Fixed `startController(callback)` and `startController(onObjectChange, onStateChange, callback)`: the callback was never called, so the test hung until its timeout (broken since 2.1.0)
|
|
28
|
+
|
|
29
|
+
### 4.0.0 (2026-10-03)
|
|
30
|
+
- (@GermanBluefox) Updated `mocha` to 12.x. The 11.x line pulls in a `serialize-javascript` with a known advisory, and an adapter using this module could not resolve that on its own. Note that `mocha` 12 needs Node.js `^20.19.0 || >=22.12.0`
|
|
31
|
+
- (@GermanBluefox) Breaking change: minimal Node.js version is now 22.19.0.
|
|
32
|
+
|
|
26
33
|
### 3.0.1 (2026-08-13)
|
|
27
34
|
- (@krobipd) `guiHelper.startBrowser`: wait until the admin web server accepts connections before opening the page — on slow CI runners the admin instance reports `alive` before its web server listens, and the single page load failed with `ERR_CONNECTION_REFUSED`.
|
|
28
35
|
|
package/build/setup.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ declare function startCustomAdapter(customAdapterName?: string, adapterInstance?
|
|
|
43
43
|
declare function startController(_isStartAdapter: boolean, _onObjectChange: ChangeHandlerObject, _onStateChange: ChangeHandlerState, _callback?: ControllerCallback): void;
|
|
44
44
|
declare function startController(_onObjectChange: ChangeHandlerObject, _onStateChange: ChangeHandlerState, _callback?: ControllerCallback): void;
|
|
45
45
|
declare function startController(_isStartAdapter: boolean, _callback?: ControllerCallback): void;
|
|
46
|
+
declare function startController(_callback?: ControllerCallback): void;
|
|
46
47
|
declare function stopAdapter(cb?: () => void): Promise<void>;
|
|
47
48
|
declare function stopCustomAdapter(customAdapterName?: string, adapterInstance?: number): Promise<void>;
|
|
48
49
|
declare function stopController(cb?: (normalTerminated: boolean) => void): Promise<void>;
|
package/build/setup.js
CHANGED
|
@@ -767,28 +767,22 @@ function startController(_isStartAdapter, _onObjectChange, _onStateChange, _call
|
|
|
767
767
|
let onObjectChange;
|
|
768
768
|
let onStateChange;
|
|
769
769
|
let callback;
|
|
770
|
-
let isStartAdapter =
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
}
|
|
787
|
-
if (typeof _onObjectChange === 'function') {
|
|
788
|
-
onObjectChange = _onObjectChange;
|
|
789
|
-
}
|
|
790
|
-
if (typeof _callback === 'function') {
|
|
791
|
-
callback = _callback;
|
|
770
|
+
let isStartAdapter = true;
|
|
771
|
+
let args = [_isStartAdapter, _onObjectChange, _onStateChange, _callback];
|
|
772
|
+
// The first argument is optional: without it, everything is shifted by one
|
|
773
|
+
if (typeof _isStartAdapter !== 'function') {
|
|
774
|
+
isStartAdapter = _isStartAdapter !== false;
|
|
775
|
+
args = args.slice(1);
|
|
776
|
+
}
|
|
777
|
+
if (args[1] === undefined) {
|
|
778
|
+
// startController([isStartAdapter,] callback)
|
|
779
|
+
callback = args[0];
|
|
780
|
+
}
|
|
781
|
+
else {
|
|
782
|
+
// startController([isStartAdapter,] onObjectChange, onStateChange, callback)
|
|
783
|
+
onObjectChange = args[0];
|
|
784
|
+
onStateChange = args[1];
|
|
785
|
+
callback = args[2];
|
|
792
786
|
}
|
|
793
787
|
if (pids.controller) {
|
|
794
788
|
console.error('Controller is already started!');
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "4.0.1",
|
|
3
3
|
"name": "@iobroker/legacy-testing",
|
|
4
4
|
"main": "build/setup.js",
|
|
5
5
|
"types": "build/setup.d.ts",
|
|
@@ -47,20 +47,23 @@
|
|
|
47
47
|
"email": "dogafox@gmail.com"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"mocha": "^
|
|
50
|
+
"mocha": "^12.0.3"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=22.19.0"
|
|
51
54
|
},
|
|
52
55
|
"devDependencies": {
|
|
53
56
|
"@alcalzone/jsonl-db": "^4.0.2",
|
|
54
57
|
"@alcalzone/release-script": "^5.2.1",
|
|
55
58
|
"@alcalzone/release-script-plugin-license": "^5.2.2",
|
|
56
|
-
"@iobroker/db-objects-redis": "^7.2.
|
|
57
|
-
"@iobroker/db-states-redis": "^7.2.
|
|
59
|
+
"@iobroker/db-objects-redis": "^7.2.4",
|
|
60
|
+
"@iobroker/db-states-redis": "^7.2.4",
|
|
58
61
|
"@iobroker/eslint-config": "^2.3.4",
|
|
59
|
-
"@iobroker/types": "^7.2.
|
|
60
|
-
"@tsconfig/
|
|
62
|
+
"@iobroker/types": "^7.2.4",
|
|
63
|
+
"@tsconfig/node22": "^22.0.6",
|
|
61
64
|
"@types/mocha": "^10.0.10",
|
|
62
|
-
"@types/node": "^
|
|
63
|
-
"typescript": "
|
|
65
|
+
"@types/node": "^22.20.5",
|
|
66
|
+
"typescript": "~6.0.3"
|
|
64
67
|
},
|
|
65
68
|
"scripts": {
|
|
66
69
|
"build": "tsc -p tsconfig.build.json",
|
|
@@ -71,6 +74,6 @@
|
|
|
71
74
|
"release-patch": "release-script patch --yes",
|
|
72
75
|
"release-minor": "release-script minor --yes",
|
|
73
76
|
"release-major": "release-script major --yes",
|
|
74
|
-
"update-packages": "
|
|
77
|
+
"update-packages": "npx -y npm-check-updates --upgrade"
|
|
75
78
|
}
|
|
76
79
|
}
|