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/test_util.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/test_util.ts')
-rw-r--r-- | cli/js/test_util.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/js/test_util.ts b/cli/js/test_util.ts index dbb7bf2c4..3e089486b 100644 --- a/cli/js/test_util.ts +++ b/cli/js/test_util.ts @@ -62,7 +62,10 @@ function permissionsMatch( requiredPerms: Permissions ): boolean { for (const permName in processPerms) { - if (processPerms[permName] !== requiredPerms[permName]) { + if ( + processPerms[permName as keyof Permissions] !== + requiredPerms[permName as keyof Permissions] + ) { return false; } } @@ -302,7 +305,7 @@ testPerm( async function assertAllUnitTestFilesImported(): Promise<void> { const directoryTestFiles = Deno.readDirSync("./cli/js") .map(k => k.name) - .filter(file => file.endsWith("_test.ts")); + .filter(file => file!.endsWith("_test.ts")); const unitTestsFile: Uint8Array = Deno.readFileSync( "./cli/js/unit_tests.ts" ); @@ -311,11 +314,11 @@ testPerm( .split("\n") .filter(line => line.startsWith("import") && line.includes("_test.ts")); const importedTestFiles = importLines.map( - relativeFilePath => relativeFilePath.match(/\/([^\/]+)";/)[1] + relativeFilePath => relativeFilePath.match(/\/([^\/]+)";/)![1] ); directoryTestFiles.forEach(dirFile => { - if (!importedTestFiles.includes(dirFile)) { + if (!importedTestFiles.includes(dirFile!)) { throw new Error( "cil/js/unit_tests.ts is missing import of test file: cli/js/" + dirFile |