summaryrefslogtreecommitdiff
path: root/js/unit_test_runner.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/unit_test_runner.ts')
-rwxr-xr-xjs/unit_test_runner.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/js/unit_test_runner.ts b/js/unit_test_runner.ts
index 7810e3f45..3a34df742 100755
--- a/js/unit_test_runner.ts
+++ b/js/unit_test_runner.ts
@@ -3,6 +3,12 @@
import "./unit_tests.ts";
import { permissionCombinations, parseUnitTestOutput } from "./test_util.ts";
+interface TestResult {
+ perms: string;
+ output: string;
+ result: number;
+}
+
function permsToCliFlags(perms: Deno.Permissions): string[] {
return Object.keys(perms)
.map(
@@ -39,7 +45,7 @@ async function main(): Promise<void> {
console.log("\t" + fmtPerms(perms));
}
- const testResults = new Set();
+ const testResults = new Set<TestResult>();
for (const perms of permissionCombinations.values()) {
const permsFmt = fmtPerms(perms);
@@ -84,10 +90,10 @@ async function main(): Promise<void> {
// run should fail
let testsFailed = false;
- for (const testResult of testResults.values()) {
+ for (const testResult of testResults) {
console.log(`Summary for ${testResult.perms}`);
console.log(testResult.output + "\n");
- testsFailed = testsFailed || testResult.result;
+ testsFailed = testsFailed || Boolean(testResult.result);
}
if (testsFailed) {