diff options
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 544123887..773c95fec 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -225,6 +225,7 @@ pub enum TestReporterConfig { Pretty, Dot, Junit, + Tap, } #[derive(Clone, Debug, Default, Eq, PartialEq)] @@ -1980,7 +1981,7 @@ Directory arguments are expanded to all contained files matching the glob Arg::new("reporter") .long("reporter") .help("Select reporter to use. Default to 'pretty'.") - .value_parser(["pretty", "dot", "junit"]) + .value_parser(["pretty", "dot", "junit", "tap"]) ) ) } @@ -3369,13 +3370,14 @@ fn test_parse(flags: &mut Flags, matches: &mut ArgMatches) { "pretty" => TestReporterConfig::Pretty, "junit" => TestReporterConfig::Junit, "dot" => TestReporterConfig::Dot, + "tap" => TestReporterConfig::Tap, _ => unreachable!(), } } else { TestReporterConfig::Pretty }; - if matches!(reporter, TestReporterConfig::Dot) { + if matches!(reporter, TestReporterConfig::Dot | TestReporterConfig::Tap) { flags.log_level = Some(Level::Error); } @@ -6839,6 +6841,21 @@ mod tests { } ); + let r = flags_from_vec(svec!["deno", "test", "--reporter=tap"]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Test(TestFlags { + reporter: TestReporterConfig::Tap, + ..Default::default() + }), + no_prompt: true, + type_check_mode: TypeCheckMode::Local, + log_level: Some(Level::Error), + ..Flags::default() + } + ); + let r = flags_from_vec(svec![ "deno", "test", |