summaryrefslogtreecommitdiff
path: root/runtime/js/41_prompt.js
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-03-28 17:49:00 -0400
committerGitHub <noreply@github.com>2023-03-28 21:49:00 +0000
commit6fb6b0c1f302e8637c96131c9ffc4c4b9f3f5f0f (patch)
treedff55c1b345f317ebd3ec5a3b62c26ed27d5830c /runtime/js/41_prompt.js
parentc65149c0a072fa710098b14776c6cd3cc8a204d6 (diff)
chore: restore pty tests and make them run on the Linux CI (#18424)
1. Rewrites the tests to be more back and forth rather than getting the output all at once (which I believe was causing the hangs on linux and maybe mac) 2. Runs the pty tests on the linux ci. 3. Fixes a bunch of tests that were just wrong. 4. Adds timeouts on the pty tests.
Diffstat (limited to 'runtime/js/41_prompt.js')
-rw-r--r--runtime/js/41_prompt.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/js/41_prompt.js b/runtime/js/41_prompt.js
index 137f17dcf..37fdaed77 100644
--- a/runtime/js/41_prompt.js
+++ b/runtime/js/41_prompt.js
@@ -37,12 +37,15 @@ function prompt(message = "Prompt", defaultValue) {
return null;
}
- core.print(`${message} `, false);
-
if (defaultValue) {
- core.print(`[${defaultValue}] `, false);
+ message += ` [${defaultValue}]`;
}
+ message += " ";
+
+ // output in one shot to make the tests more reliable
+ core.print(message, false);
+
return readLineFromStdinSync() || defaultValue;
}