diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-11-30 23:25:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-30 23:25:20 +0100 |
commit | d1962e07afb3761c85cde90bda751c23c144741f (patch) | |
tree | c65d5adfe28427d06a51de1d9c3c13923ee2b95c /cli/tests | |
parent | 381932ce1e79f38bbf8bdf28b4e808038aead7a7 (diff) |
fix(repl): respect --quiet flag (#16875)
This commit changes REPL behavior to respect --quiet flag. Once
this flag is present REPL will not print a banner at the start.
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/repl_tests.rs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/cli/tests/repl_tests.rs b/cli/tests/repl_tests.rs index edc7918f9..281ae0746 100644 --- a/cli/tests/repl_tests.rs +++ b/cli/tests/repl_tests.rs @@ -732,7 +732,7 @@ mod repl { ); assert_contains!( test_util::strip_ansi_codes(&out), - "error in --eval flag. parse error: Unexpected token `%`." + "Error in --eval flag: parse error: Unexpected token `%`." ); assert_contains!(out, "2500"); // should not prevent input assert!(err.is_empty()); @@ -747,7 +747,7 @@ mod repl { None, false, ); - assert_contains!(out, "error in --eval flag. Uncaught Error: Testing"); + assert_contains!(out, "Error in --eval flag: Uncaught Error: Testing"); assert_contains!(out, "2500"); // should not prevent input assert!(err.is_empty()); } @@ -881,4 +881,19 @@ mod repl { assert_contains!(out, "AggregateError"); assert!(err.is_empty()); } + + #[test] + fn repl_with_quiet_flag() { + let (out, err) = util::run_and_collect_output_with_args( + true, + vec!["repl", "--quiet"], + Some(vec!["await Promise.resolve('done')"]), + Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), + false, + ); + assert!(!out.contains("Deno")); + assert!(!out.contains("exit using ctrl+d, ctrl+c, or close()")); + assert_ends_with!(out, "\"done\"\n"); + assert!(err.is_empty()); + } } |