mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
feat(test): add default to --coverage option (#21510)
This commit is contained in:
parent
d68d1e2022
commit
2b3daa690d
1 changed files with 21 additions and 2 deletions
|
@ -2161,12 +2161,14 @@ Directory arguments are expanded to all contained files matching the glob
|
|||
.arg(
|
||||
Arg::new("coverage")
|
||||
.long("coverage")
|
||||
.require_equals(true)
|
||||
.value_name("DIR")
|
||||
.num_args(0..=1)
|
||||
.require_equals(true)
|
||||
.default_missing_value("coverage")
|
||||
.conflicts_with("inspect")
|
||||
.conflicts_with("inspect-wait")
|
||||
.conflicts_with("inspect-brk")
|
||||
.help("Collect coverage profile data into DIR"),
|
||||
.help("Collect coverage profile data into DIR. If DIR is not specified, it uses 'coverage/'."),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("parallel")
|
||||
|
@ -7436,6 +7438,23 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_coverage_default_dir() {
|
||||
let r = flags_from_vec(svec!["deno", "test", "--coverage"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
subcommand: DenoSubcommand::Test(TestFlags {
|
||||
coverage_dir: Some("coverage".to_string()),
|
||||
..TestFlags::default()
|
||||
}),
|
||||
type_check_mode: TypeCheckMode::Local,
|
||||
no_prompt: true,
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bundle_with_cafile() {
|
||||
let r = flags_from_vec(svec![
|
||||
|
|
Loading…
Reference in a new issue