summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-01-12 02:35:55 +0530
committerGitHub <noreply@github.com>2024-01-11 22:05:55 +0100
commit9268df5f3405103214b4e39d82e5ab1b465475a0 (patch)
tree76336155130a2e751a9509df370d0060020473ac /cli/tests
parentd8f86c8b9cf327db4d246c20cf60467cafe2ba64 (diff)
fix(web): use rustyline for prompt (#21893)
Workaround until https://github.com/kkawakam/rustyline/pull/759
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/run_tests.rs9
-rw-r--r--cli/tests/testdata/run/066_prompt.ts4
2 files changed, 2 insertions, 11 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs
index 36eee1100..2a349a5f2 100644
--- a/cli/tests/integration/run_tests.rs
+++ b/cli/tests/integration/run_tests.rs
@@ -2823,12 +2823,10 @@ mod permissions {
.new_command()
.args_vec(["run", "--quiet", "--unstable", "run/066_prompt.ts"])
.with_pty(|mut console| {
- console.expect("What is your name? [Jane Doe] ");
- console.write_line_raw("John Doe");
- console.expect("Your name is John Doe.");
- console.expect("What is your name? [Jane Doe] ");
+ console.expect("What is your name? Jane Doe");
console.write_line_raw("");
console.expect("Your name is Jane Doe.");
+
console.expect("Prompt ");
console.write_line_raw("foo");
console.expect("Your input is foo.");
@@ -2852,9 +2850,6 @@ mod permissions {
console.expect("Alert [Enter] ");
console.write_line("");
console.expect("The end of test");
- console.expect("What is EOF? ");
- console.write_line("");
- console.expect("Your answer is null");
});
}
diff --git a/cli/tests/testdata/run/066_prompt.ts b/cli/tests/testdata/run/066_prompt.ts
index e3daa7ac0..f059be685 100644
--- a/cli/tests/testdata/run/066_prompt.ts
+++ b/cli/tests/testdata/run/066_prompt.ts
@@ -1,5 +1,3 @@
-const name0 = prompt("What is your name?", "Jane Doe"); // Answer John Doe
-console.log(`Your name is ${name0}.`);
const name1 = prompt("What is your name?", "Jane Doe"); // Answer with default
console.log(`Your name is ${name1}.`);
const input = prompt(); // Answer foo
@@ -17,5 +15,3 @@ console.log(`Your answer is ${JSON.stringify(windows)}`);
alert("Hi");
alert();
console.log("The end of test");
-const eof = prompt("What is EOF?");
-console.log(`Your answer is ${JSON.stringify(eof)}`);