summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/deno_test_no_color.ts17
-rw-r--r--cli/tests/integration_tests.rs16
2 files changed, 33 insertions, 0 deletions
diff --git a/cli/tests/deno_test_no_color.ts b/cli/tests/deno_test_no_color.ts
new file mode 100644
index 000000000..38c531ee9
--- /dev/null
+++ b/cli/tests/deno_test_no_color.ts
@@ -0,0 +1,17 @@
+Deno.test({
+ name: "success",
+ fn() {},
+});
+
+Deno.test({
+ name: "fail",
+ fn() {
+ throw new Error("fail");
+ },
+});
+
+Deno.test({
+ name: "ignored",
+ ignore: true,
+ fn() {},
+});
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index cbd0dbc26..78a89eb2b 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -1120,6 +1120,22 @@ fn repl_test_assign_underscore_error() {
}
#[test]
+fn deno_test_no_color() {
+ let (out, _) = util::run_and_collect_output(
+ false,
+ "test deno_test_no_color.ts",
+ None,
+ Some(vec![("NO_COLOR".to_owned(), "true".to_owned())]),
+ false,
+ );
+ // ANSI escape codes should be stripped.
+ assert!(out.contains("test success ... ok"));
+ assert!(out.contains("test fail ... FAILED"));
+ assert!(out.contains("test ignored ... ignored"));
+ assert!(out.contains("test result: FAILED. 1 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out"));
+}
+
+#[test]
fn util_test() {
util::run_python_script("tools/util_test.py")
}