diff options
author | Maximilien Mellen <maxmellen0@gmail.com> | 2020-02-19 21:36:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-19 15:36:18 -0500 |
commit | 90125566bbaed8b5c6e55ca8dbc432e3433fb73c (patch) | |
tree | bf798a408b26264641260395ce8cfc9d4bb37637 /cli/js/process_test.ts | |
parent | 852823fa505d75d61e70e1330bbf366aa248e650 (diff) |
Enable TS strict mode by default (#3899)
Fixes #3324
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
Diffstat (limited to 'cli/js/process_test.ts')
-rw-r--r-- | cli/js/process_test.ts | 17 |
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); }); |