summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/readline_test.ts
diff options
context:
space:
mode:
authorMarvin Hagemeister <hello@marvinh.dev>2023-05-18 21:42:27 +0200
committerGitHub <noreply@github.com>2023-05-18 15:42:27 -0400
commitff0daa2b9d8a149d36173e19ce8dc169921486c7 (patch)
treeec914a4e736cf797420f6390a7667e427c7f37b7 /cli/tests/unit_node/readline_test.ts
parent877b38b37043c1f45577f1835119caa7df6169e3 (diff)
fix(npm): `process` not defined in readline (#19184)
Issue was that we create node globals much later, so pulling `process` via a module import is the way to go. Fixes #19183
Diffstat (limited to 'cli/tests/unit_node/readline_test.ts')
-rw-r--r--cli/tests/unit_node/readline_test.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/tests/unit_node/readline_test.ts b/cli/tests/unit_node/readline_test.ts
index bef9008dd..914d23e4a 100644
--- a/cli/tests/unit_node/readline_test.ts
+++ b/cli/tests/unit_node/readline_test.ts
@@ -12,3 +12,16 @@ Deno.test("[node/readline] createInstance", () => {
// deno-lint-ignore no-explicit-any
assertInstanceOf(rl, Interface as any);
});
+
+// Test for https://github.com/denoland/deno/issues/19183
+Deno.test("[node/readline] don't throw on rl.question()", () => {
+ const rli = createInterface({
+ input: new Readable({ read() {} }),
+ output: new Writable({ write() {} }),
+ terminal: true,
+ });
+
+ // Calling this would throw
+ rli.question("foo", () => rli.close());
+ rli.close();
+});