0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-12 16:59:32 -05:00

fix(coverage): rename --pretty to --detailed (#21543)

This commit is contained in:
Yoshiya Hinosawa 2023-12-12 20:53:41 +09:00 committed by GitHub
parent 7d88e48296
commit 93ea46b31d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 18 deletions

View file

@ -87,7 +87,7 @@ pub struct CompletionsFlags {
#[derive(Clone, Debug, Eq, PartialEq)] #[derive(Clone, Debug, Eq, PartialEq)]
pub enum CoverageType { pub enum CoverageType {
Summary, Summary,
Pretty, Detailed,
Lcov, Lcov,
Html, Html,
} }
@ -1415,9 +1415,9 @@ Generate html reports from lcov:
.action(ArgAction::SetTrue), .action(ArgAction::SetTrue),
) )
.arg( .arg(
Arg::new("pretty") Arg::new("detailed")
.long("pretty") .long("detailed")
.help("Output coverage report in pretty format in the terminal.") .help("Output coverage report in detailed format in the terminal.")
.action(ArgAction::SetTrue), .action(ArgAction::SetTrue),
) )
.arg( .arg(
@ -3327,8 +3327,8 @@ fn coverage_parse(flags: &mut Flags, matches: &mut ArgMatches) {
CoverageType::Lcov CoverageType::Lcov
} else if matches.get_flag("html") { } else if matches.get_flag("html") {
CoverageType::Html CoverageType::Html
} else if matches.get_flag("pretty") { } else if matches.get_flag("detailed") {
CoverageType::Pretty CoverageType::Detailed
} else { } else {
CoverageType::Summary CoverageType::Summary
}; };

View file

@ -117,7 +117,7 @@ fn run_coverage_text(test_name: &str, extension: &str) {
.new_command() .new_command()
.args_vec(vec![ .args_vec(vec![
"coverage".to_string(), "coverage".to_string(),
"--pretty".to_string(), "--detailed".to_string(),
format!("{}/", tempdir), format!("{}/", tempdir),
]) ])
.split_output() .split_output()
@ -190,7 +190,7 @@ fn multifile_coverage() {
.new_command() .new_command()
.args_vec(vec![ .args_vec(vec![
"coverage".to_string(), "coverage".to_string(),
"--pretty".to_string(), "--detailed".to_string(),
format!("{}/", tempdir), format!("{}/", tempdir),
]) ])
.split_output() .split_output()
@ -263,7 +263,7 @@ fn no_snaps_included(test_name: &str, extension: &str) {
.args_vec(vec![ .args_vec(vec![
"coverage".to_string(), "coverage".to_string(),
"--include=no_snaps_included.ts".to_string(), "--include=no_snaps_included.ts".to_string(),
"--pretty".to_string(), "--detailed".to_string(),
format!("{}/", tempdir), format!("{}/", tempdir),
]) ])
.split_output() .split_output()
@ -312,7 +312,7 @@ fn no_tests_included(test_name: &str, extension: &str) {
.args_vec(vec![ .args_vec(vec![
"coverage".to_string(), "coverage".to_string(),
format!("--exclude={}", util::std_path().canonicalize()), format!("--exclude={}", util::std_path().canonicalize()),
"--pretty".to_string(), "--detailed".to_string(),
format!("{}/", tempdir), format!("{}/", tempdir),
]) ])
.split_output() .split_output()
@ -362,7 +362,7 @@ fn no_npm_cache_coverage() {
.new_command() .new_command()
.args_vec(vec![ .args_vec(vec![
"coverage".to_string(), "coverage".to_string(),
"--pretty".to_string(), "--detailed".to_string(),
format!("{}/", tempdir), format!("{}/", tempdir),
]) ])
.split_output() .split_output()
@ -411,7 +411,7 @@ fn no_transpiled_lines() {
.args_vec(vec![ .args_vec(vec![
"coverage".to_string(), "coverage".to_string(),
"--include=no_transpiled_lines/index.ts".to_string(), "--include=no_transpiled_lines/index.ts".to_string(),
"--pretty".to_string(), "--detailed".to_string(),
format!("{}/", tempdir), format!("{}/", tempdir),
]) ])
.run(); .run();

View file

@ -32,7 +32,7 @@ pub fn create(kind: CoverageType) -> Box<dyn CoverageReporter + Send> {
match kind { match kind {
CoverageType::Summary => Box::new(SummaryCoverageReporter::new()), CoverageType::Summary => Box::new(SummaryCoverageReporter::new()),
CoverageType::Lcov => Box::new(LcovCoverageReporter::new()), CoverageType::Lcov => Box::new(LcovCoverageReporter::new()),
CoverageType::Pretty => Box::new(PrettyCoverageReporter::new()), CoverageType::Detailed => Box::new(DetailedCoverageReporter::new()),
CoverageType::Html => Box::new(HtmlCoverageReporter::new()), CoverageType::Html => Box::new(HtmlCoverageReporter::new()),
} }
} }
@ -304,15 +304,15 @@ impl CoverageReporter for LcovCoverageReporter {
} }
} }
struct PrettyCoverageReporter {} struct DetailedCoverageReporter {}
impl PrettyCoverageReporter { impl DetailedCoverageReporter {
pub fn new() -> PrettyCoverageReporter { pub fn new() -> DetailedCoverageReporter {
PrettyCoverageReporter {} DetailedCoverageReporter {}
} }
} }
impl CoverageReporter for PrettyCoverageReporter { impl CoverageReporter for DetailedCoverageReporter {
fn report( fn report(
&mut self, &mut self,
coverage_report: &CoverageReport, coverage_report: &CoverageReport,