diff options
author | Speykious <speykious.the.king@gmail.com> | 2020-05-19 20:19:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-19 14:19:26 -0400 |
commit | 9752b853ddac3ba41378d0ae8a8604a28e285ffb (patch) | |
tree | 1082dc9786adf3dbbda04b39b67ff3f421a6736f /cli/tests/integration_tests.rs | |
parent | cdc9323cccdee544562712018f722026bdfbbd6c (diff) |
Provide better ANSI colorized output when inspecting objects (#5404)
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r-- | cli/tests/integration_tests.rs | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 45c3a011f..103e3142e 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -80,7 +80,7 @@ fn no_color() { .unwrap(); assert!(output.status.success()); let stdout_str = std::str::from_utf8(&output.stdout).unwrap().trim(); - assert_eq!("noColor false", stdout_str); + assert_eq!("noColor false", util::strip_ansi_codes(stdout_str)); } // TODO re-enable. This hangs on macOS @@ -403,6 +403,7 @@ fn js_unit_tests() { .arg("cli/js/tests/unit_test_runner.ts") .arg("--master") .arg("--verbose") + .env("NO_COLOR", "1") .spawn() .expect("failed to spawn script"); let status = deno.wait().expect("failed to wait for the child process"); @@ -672,7 +673,7 @@ fn repl_test_console_log() { true, "repl", Some(vec!["console.log('hello')", "'world'"]), - None, + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); assert!(out.ends_with("hello\nundefined\nworld\n")); @@ -685,7 +686,7 @@ fn repl_test_eof() { true, "repl", Some(vec!["1 + 2"]), - None, + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); assert!(out.ends_with("3\n")); @@ -714,7 +715,7 @@ fn repl_test_function() { true, "repl", Some(vec!["Deno.writeFileSync"]), - None, + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); assert!(out.ends_with("[Function: writeFileSync]\n")); @@ -727,7 +728,7 @@ fn repl_test_multiline() { true, "repl", Some(vec!["(\n1 + 2\n)"]), - None, + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); assert!(out.ends_with("3\n")); @@ -792,7 +793,7 @@ fn repl_test_variable() { true, "repl", Some(vec!["var a = 123;", "a"]), - None, + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); assert!(out.ends_with("undefined\n123\n")); @@ -805,7 +806,7 @@ fn repl_test_lexical_scoped_variable() { true, "repl", Some(vec!["let a = 123;", "a"]), - None, + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); assert!(out.ends_with("undefined\n123\n")); @@ -822,7 +823,10 @@ fn repl_test_missing_deno_dir() { true, "repl", Some(vec!["1"]), - Some(vec![("DENO_DIR".to_owned(), DENO_DIR.to_owned())]), + Some(vec![ + ("DENO_DIR".to_owned(), DENO_DIR.to_owned()), + ("NO_COLOR".to_owned(), "1".to_owned()), + ]), false, ); assert!(read_dir(&test_deno_dir).is_ok()); @@ -837,7 +841,7 @@ fn repl_test_save_last_eval() { true, "repl", Some(vec!["1", "_"]), - None, + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); assert!(out.ends_with("1\n1\n")); @@ -850,7 +854,7 @@ fn repl_test_save_last_thrown() { true, "repl", Some(vec!["throw 1", "_error"]), - None, + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); assert!(out.ends_with("1\n")); @@ -863,7 +867,7 @@ fn repl_test_assign_underscore() { true, "repl", Some(vec!["_ = 1", "2", "_"]), - None, + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); assert!( @@ -878,7 +882,7 @@ fn repl_test_assign_underscore_error() { true, "repl", Some(vec!["_error = 1", "throw 2", "_error"]), - None, + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); assert!( @@ -1535,6 +1539,7 @@ itest!(lib_runtime_api { itest!(seed_random { args: "run --seed=100 seed_random.js", + output: "seed_random.js.out", }); @@ -2370,6 +2375,7 @@ async fn inspector_does_not_hang() { // Warning: each inspector test should be on its own port to avoid // conflicting with another inspector test. .arg("--inspect-brk=127.0.0.1:9232") + .env("NO_COLOR", "1") .arg(script) .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::piped()) |