summaryrefslogtreecommitdiff
path: root/cli/js/process_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/process_test.ts')
-rw-r--r--cli/js/process_test.ts17
1 files changed, 9 insertions, 8 deletions
diff --git a/cli/js/process_test.ts b/cli/js/process_test.ts
index 943359e54..dce4d9918 100644
--- a/cli/js/process_test.ts
+++ b/cli/js/process_test.ts
@@ -130,6 +130,7 @@ testPerm({ run: true }, async function runStdinPiped(): Promise<void> {
args: ["python", "-c", "import sys; assert 'hello' == sys.stdin.read();"],
stdin: "piped"
});
+ assert(p.stdin);
assert(!p.stdout);
assert(!p.stderr);
@@ -137,7 +138,7 @@ testPerm({ run: true }, async function runStdinPiped(): Promise<void> {
const n = await p.stdin.write(msg);
assertEquals(n, msg.byteLength);
- p.stdin.close();
+ p.stdin!.close();
const status = await p.status();
assertEquals(status.success, true);
@@ -155,16 +156,16 @@ testPerm({ run: true }, async function runStdoutPiped(): Promise<void> {
assert(!p.stderr);
const data = new Uint8Array(10);
- let r = await p.stdout.read(data);
+ let r = await p.stdout!.read(data);
if (r === Deno.EOF) {
throw new Error("p.stdout.read(...) should not be EOF");
}
assertEquals(r, 5);
const s = new TextDecoder().decode(data.subarray(0, r));
assertEquals(s, "hello");
- r = await p.stdout.read(data);
+ r = await p.stdout!.read(data);
assertEquals(r, Deno.EOF);
- p.stdout.close();
+ p.stdout!.close();
const status = await p.status();
assertEquals(status.success, true);
@@ -182,16 +183,16 @@ testPerm({ run: true }, async function runStderrPiped(): Promise<void> {
assert(!p.stdout);
const data = new Uint8Array(10);
- let r = await p.stderr.read(data);
+ let r = await p.stderr!.read(data);
if (r === Deno.EOF) {
throw new Error("p.stderr.read should not return EOF here");
}
assertEquals(r, 5);
const s = new TextDecoder().decode(data.subarray(0, r));
assertEquals(s, "hello");
- r = await p.stderr.read(data);
+ r = await p.stderr!.read(data);
assertEquals(r, Deno.EOF);
- p.stderr.close();
+ p.stderr!.close();
const status = await p.status();
assertEquals(status.success, true);
@@ -307,7 +308,7 @@ testPerm({ run: true }, async function runClose(): Promise<void> {
p.close();
const data = new Uint8Array(10);
- const r = await p.stderr.read(data);
+ const r = await p.stderr!.read(data);
assertEquals(r, Deno.EOF);
});