summaryrefslogtreecommitdiff
path: root/cli/tests/unit/unit_test_runner.ts
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-06-12 16:58:04 +0100
committerGitHub <noreply@github.com>2020-06-12 11:58:04 -0400
commite613bfe47a3ebec076c82d038738904114ff2a7c (patch)
treec9deee488fc8dd3bf7fdcdd65be1f8677307a1d0 /cli/tests/unit/unit_test_runner.ts
parent3eee9614732ed8636bb8ebbd6f6a13d44531df6c (diff)
feat: Add TestDefinition::only (#5793)
Diffstat (limited to 'cli/tests/unit/unit_test_runner.ts')
-rwxr-xr-xcli/tests/unit/unit_test_runner.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/tests/unit/unit_test_runner.ts b/cli/tests/unit/unit_test_runner.ts
index e3df358d7..38db545c7 100755
--- a/cli/tests/unit/unit_test_runner.ts
+++ b/cli/tests/unit/unit_test_runner.ts
@@ -2,6 +2,8 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import "./unit_tests.ts";
import {
+ REGISTERED_UNIT_TESTS,
+ colors,
readLines,
permissionCombinations,
Permissions,
@@ -225,6 +227,13 @@ async function masterRunnerMain(
}
console.log("Unit tests passed");
+
+ if (REGISTERED_UNIT_TESTS.find(({ only }) => only)) {
+ console.error(
+ `\n${colors.red("FAILED")} because the "only" option was used`
+ );
+ Deno.exit(1);
+ }
}
const HELP = `Unit test runner