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/chmod_test.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'cli/js/chmod_test.ts') diff --git a/cli/js/chmod_test.ts b/cli/js/chmod_test.ts index 3ecb4256a..b3b0a2ae2 100644 --- a/cli/js/chmod_test.ts +++ b/cli/js/chmod_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { testPerm, assertEquals } from "./test_util.ts"; +import { testPerm, assert, assertEquals } from "./test_util.ts"; const isNotWindows = Deno.build.os !== "win"; @@ -16,6 +16,7 @@ testPerm({ read: true, write: true }, function chmodSyncSuccess(): void { // Check success when not on windows if (isNotWindows) { const fileInfo = Deno.statSync(filename); + assert(fileInfo.mode); assertEquals(fileInfo.mode & 0o777, 0o777); } }); @@ -35,14 +36,17 @@ if (isNotWindows) { Deno.symlinkSync(filename, symlinkName); let symlinkInfo = Deno.lstatSync(symlinkName); + assert(symlinkInfo.mode); const symlinkMode = symlinkInfo.mode & 0o777; // platform dependent Deno.chmodSync(symlinkName, 0o777); // Change actual file mode, not symlink const fileInfo = Deno.statSync(filename); + assert(fileInfo.mode); assertEquals(fileInfo.mode & 0o777, 0o777); symlinkInfo = Deno.lstatSync(symlinkName); + assert(symlinkInfo.mode); assertEquals(symlinkInfo.mode & 0o777, symlinkMode); } ); @@ -86,6 +90,7 @@ testPerm({ read: true, write: true }, async function chmodSuccess(): Promise< // Check success when not on windows if (isNotWindows) { const fileInfo = Deno.statSync(filename); + assert(fileInfo.mode); assertEquals(fileInfo.mode & 0o777, 0o777); } }); @@ -105,14 +110,17 @@ if (isNotWindows) { Deno.symlinkSync(filename, symlinkName); let symlinkInfo = Deno.lstatSync(symlinkName); + assert(symlinkInfo.mode); const symlinkMode = symlinkInfo.mode & 0o777; // platform dependent await Deno.chmod(symlinkName, 0o777); // Just change actual file mode, not symlink const fileInfo = Deno.statSync(filename); + assert(fileInfo.mode); assertEquals(fileInfo.mode & 0o777, 0o777); symlinkInfo = Deno.lstatSync(symlinkName); + assert(symlinkInfo.mode); assertEquals(symlinkInfo.mode & 0o777, symlinkMode); } ); -- cgit v1.2.3