summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2021-07-10 07:29:18 +0800
committerGitHub <noreply@github.com>2021-07-10 01:29:18 +0200
commit9d57a4aaeb18461bbeeea30fc8ab8804357185c1 (patch)
tree3fc1bb0bbb06519c36def59e0d1dc09859c676f5 /cli/tests
parent9b89668065a5cd23f4326855980f7dd59182efaf (diff)
feat(cli/tools/test_runner): add terse reporter (#11156)
This commit adds "--terse" flag to "deno test" that makes testing reporter output one character per test case instead of one line per case. This is an unstable feature.
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/test_tests.rs6
-rw-r--r--cli/tests/test/terse.out11
-rw-r--r--cli/tests/test/terse.ts11
3 files changed, 28 insertions, 0 deletions
diff --git a/cli/tests/integration/test_tests.rs b/cli/tests/integration/test_tests.rs
index c029b154d..134a2d47b 100644
--- a/cli/tests/integration/test_tests.rs
+++ b/cli/tests/integration/test_tests.rs
@@ -49,6 +49,12 @@ itest!(doc {
output: "test/doc.out",
});
+itest!(terse {
+ args: "test --terse test/terse.ts",
+ exit_code: 1,
+ output: "test/terse.out",
+});
+
itest!(quiet {
args: "test --quiet test/quiet.ts",
exit_code: 0,
diff --git a/cli/tests/test/terse.out b/cli/tests/test/terse.out
new file mode 100644
index 000000000..3d5deaf39
--- /dev/null
+++ b/cli/tests/test/terse.out
@@ -0,0 +1,11 @@
+Check [WILDCARD]/test/terse.ts
+running 3 tests from [WILDCARD]
+.Fi
+failures:
+
+fail
+Error: fail
+ [WILDCARD]
+
+test result: FAILED. 1 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out [WILDCARD]
+
diff --git a/cli/tests/test/terse.ts b/cli/tests/test/terse.ts
new file mode 100644
index 000000000..b2168a0d9
--- /dev/null
+++ b/cli/tests/test/terse.ts
@@ -0,0 +1,11 @@
+Deno.test("ok", function () {});
+
+Deno.test("fail", function () {
+ throw new Error("fail");
+});
+
+Deno.test({
+ name: "ignore",
+ fn() {},
+ ignore: true,
+});