From 90125566bbaed8b5c6e55ca8dbc432e3433fb73c Mon Sep 17 00:00:00 2001 From: Maximilien Mellen Date: Wed, 19 Feb 2020 21:36:18 +0100 Subject: Enable TS strict mode by default (#3899) Fixes #3324 Co-authored-by: Kitson Kelly --- cli/js/process_test.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'cli/js/process_test.ts') 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 { 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 { 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 { 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 { 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 { 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); }); -- cgit v1.2.3