@mablhq/mabl-cli 2.79.7 → 2.79.9
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.
|
@@ -7,6 +7,7 @@ exports.getTestOutputUrl = getTestOutputUrl;
|
|
|
7
7
|
exports.getCreateTestOutputText = getCreateTestOutputText;
|
|
8
8
|
const zod_1 = require("zod");
|
|
9
9
|
const env_1 = require("../../../../env/env");
|
|
10
|
+
const openUtils_1 = require("../../../../core/trainer/openUtils");
|
|
10
11
|
exports.testOutputSchema = zod_1.z.object({
|
|
11
12
|
id: zod_1.z.string(),
|
|
12
13
|
name: zod_1.z.string(),
|
|
@@ -53,7 +54,7 @@ function getTestOutputUrl(workspaceId, testRunId) {
|
|
|
53
54
|
return `${env_1.BASE_APP_URL}/workspaces/${workspaceId}/output/test-runs/${testRunId}`;
|
|
54
55
|
}
|
|
55
56
|
function getCreateTestOutputText(trainerUrl) {
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
return process.platform === openUtils_1.WIN32_PLATFORM
|
|
58
|
+
? `Tell the user to open the following URL to launch the mabl trainer: ${trainerUrl}. Show it using a link, trying to hide the full URL. If you have a tool that can open a link use it.`
|
|
59
|
+
: `A mabl trainer was launched. If you don't see the trainer running, open the following URL: ${trainerUrl} to open the trainer manually (Show the URL to the user using and explain to the user how to open it. If you have a tool that can open a link use it.).`;
|
|
59
60
|
}
|
|
@@ -63,12 +63,17 @@ async function createConfigServer(config) {
|
|
|
63
63
|
return new Promise((resolve, reject) => {
|
|
64
64
|
server.listen(0, () => {
|
|
65
65
|
const port = server.address().port;
|
|
66
|
-
const requestPromise = new Promise((resolveRequest
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
const requestPromise = new Promise((resolveRequest) => {
|
|
67
|
+
let timeout;
|
|
68
|
+
if (process.platform !== exports.WIN32_PLATFORM) {
|
|
69
|
+
timeout = (0, timers_1.setTimeout)(() => {
|
|
70
|
+
resolveRequest();
|
|
71
|
+
}, 20_000);
|
|
72
|
+
}
|
|
70
73
|
server.on('close', () => {
|
|
71
|
-
|
|
74
|
+
if (timeout) {
|
|
75
|
+
global.clearTimeout(timeout);
|
|
76
|
+
}
|
|
72
77
|
resolveRequest();
|
|
73
78
|
});
|
|
74
79
|
});
|