Enable TS strict mode by default (#3899)

Fixes #3324 

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
This commit is contained in:
Maximilien Mellen 2020-02-19 21:36:18 +01:00 committed by GitHub
parent 852823fa50
commit 90125566bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 314 additions and 179 deletions

View file

@ -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);
});