@iobroker/testing 4.1.1 → 4.1.2
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.
|
@@ -30,10 +30,15 @@ function executeCommand(command, argsOrOptions, options) {
|
|
|
30
30
|
spawnOptions.cwd = options.cwd;
|
|
31
31
|
// Fix npm / node executable paths on Windows
|
|
32
32
|
if (isWindows) {
|
|
33
|
-
if (command === "npm")
|
|
33
|
+
if (command === "npm") {
|
|
34
34
|
command += ".cmd";
|
|
35
|
-
|
|
35
|
+
// Needed since Node.js v18.20.2 and v20.12.2
|
|
36
|
+
// https://github.com/nodejs/node/releases/tag/v18.20.2
|
|
37
|
+
spawnOptions.shell = true;
|
|
38
|
+
}
|
|
39
|
+
else if (command === "node") {
|
|
36
40
|
command += ".exe";
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
43
|
if (options.logCommandExecution == null)
|
|
39
44
|
options.logCommandExecution = false;
|
|
@@ -117,6 +117,12 @@ class ControllerSetup {
|
|
|
117
117
|
debug("Testing if JS-Controller is running...");
|
|
118
118
|
return new Promise((resolve) => {
|
|
119
119
|
const client = new net_1.Socket();
|
|
120
|
+
const timeout = setTimeout(() => {
|
|
121
|
+
// Assume the connection failed after 1 s
|
|
122
|
+
client.destroy();
|
|
123
|
+
debug(` => false`);
|
|
124
|
+
resolve(false);
|
|
125
|
+
}, 1000);
|
|
120
126
|
// Try to connect to an existing ObjectsDB
|
|
121
127
|
client
|
|
122
128
|
.connect({
|
|
@@ -127,19 +133,15 @@ class ControllerSetup {
|
|
|
127
133
|
// The connection succeeded
|
|
128
134
|
client.destroy();
|
|
129
135
|
debug(` => true`);
|
|
136
|
+
clearTimeout(timeout);
|
|
130
137
|
resolve(true);
|
|
131
138
|
})
|
|
132
139
|
.on("error", () => {
|
|
133
140
|
client.destroy();
|
|
134
141
|
debug(` => false`);
|
|
142
|
+
clearTimeout(timeout);
|
|
135
143
|
resolve(false);
|
|
136
144
|
});
|
|
137
|
-
setTimeout(() => {
|
|
138
|
-
// Assume the connection failed after 1 s
|
|
139
|
-
client.destroy();
|
|
140
|
-
debug(` => false`);
|
|
141
|
-
resolve(false);
|
|
142
|
-
}, 1000);
|
|
143
145
|
});
|
|
144
146
|
}
|
|
145
147
|
// /**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/testing",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "Shared utilities for adapter and module testing in ioBroker",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/AlCalzone/testing#readme",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@alcalzone/release-script": "^3.
|
|
41
|
+
"@alcalzone/release-script": "^3.7.0",
|
|
42
42
|
"@alcalzone/release-script-plugin-license": "^3.5.9",
|
|
43
43
|
"@iobroker/adapter-core": "^2.6.8",
|
|
44
44
|
"@tsconfig/node14": "^1.0.3",
|