summaryrefslogtreecommitdiff
path: root/std/node/process_test.ts
diff options
context:
space:
mode:
authorJarrett Helton <jaydhelton@gmail.com>2020-09-17 23:31:50 -0400
committerGitHub <noreply@github.com>2020-09-17 23:31:50 -0400
commitcead79f5b8ffd376d339b6e0c30e872bfe6820f6 (patch)
tree3895879f3a413aa8a2ef43394ed371794478537a /std/node/process_test.ts
parente4188f7dfb95ad16750874dd2cdd4a80b48b1ecc (diff)
feat(std/node) stub out process.stdin, stdout, stderr (#7184)
Diffstat (limited to 'std/node/process_test.ts')
-rw-r--r--std/node/process_test.ts35
1 files changed, 34 insertions, 1 deletions
diff --git a/std/node/process_test.ts b/std/node/process_test.ts
index 4055dfd78..a277eaa07 100644
--- a/std/node/process_test.ts
+++ b/std/node/process_test.ts
@@ -18,8 +18,11 @@ Deno.test({
allKeys.delete("process");
// without esm default
allKeys.delete("default");
- // with on, which is not exported via *
+ // with on, stdin, stderr, and stdout, which is not exported via *
allKeys.add("on");
+ allKeys.add("stdin");
+ allKeys.add("stderr");
+ allKeys.add("stdout");
const allStr = Array.from(allKeys).sort().join(" ");
assertEquals(Object.keys(all.default).sort().join(" "), allStr);
assertEquals(Object.keys(all.process).sort().join(" "), allStr);
@@ -130,3 +133,33 @@ Deno.test({
assertEquals(typeof env.PATH, "string");
},
});
+
+Deno.test({
+ name: "process.stdin",
+ fn() {
+ assertEquals(typeof process.stdin.fd, "number");
+ assertEquals(process.stdin.fd, Deno.stdin.rid);
+ // TODO(jayhelton) Uncomment out this assertion once PTY is supported
+ //assert(process.stdin.isTTY);
+ },
+});
+
+Deno.test({
+ name: "process.stdout",
+ fn() {
+ assertEquals(typeof process.stdout.fd, "number");
+ assertEquals(process.stdout.fd, Deno.stdout.rid);
+ // TODO(jayhelton) Uncomment out this assertion once PTY is supported
+ // assert(process.stdout.isTTY);
+ },
+});
+
+Deno.test({
+ name: "process.stderr",
+ fn() {
+ assertEquals(typeof process.stderr.fd, "number");
+ assertEquals(process.stderr.fd, Deno.stderr.rid);
+ // TODO(jayhelton) Uncomment out this assertion once PTY is supported
+ // assert(process.stderr.isTTY);
+ },
+});