0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-01 20:25:12 -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)]
pub enum CoverageType {
Summary,
Pretty,
Detailed,
Lcov,
Html,
}
@ -1415,9 +1415,9 @@ Generate html reports from lcov:
.action(ArgAction::SetTrue),
)
.arg(
Arg::new("pretty")
.long("pretty")
.help("Output coverage report in pretty format in the terminal.")
Arg::new("detailed")
.long("detailed")
.help("Output coverage report in detailed format in the terminal.")
.action(ArgAction::SetTrue),
)
.arg(
@ -3327,8 +3327,8 @@ fn coverage_parse(flags: &mut Flags, matches: &mut ArgMatches) {
CoverageType::Lcov
} else if matches.get_flag("html") {
CoverageType::Html
} else if matches.get_flag("pretty") {
CoverageType::Pretty
} else if matches.get_flag("detailed") {
CoverageType::Detailed
} else {
CoverageType::Summary
};

View file

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

View file

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