mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 21:24:48 +00:00
feat: deno test --filter (#4570)
This commit is contained in:
parent
ff0b32f81d
commit
c738797944
6 changed files with 325 additions and 289 deletions
|
@ -445,6 +445,7 @@ async fn test_command(
|
|||
include: Option<Vec<String>>,
|
||||
fail_fast: bool,
|
||||
allow_none: bool,
|
||||
filter: Option<String>,
|
||||
) -> Result<(), ErrBox> {
|
||||
let global_state = GlobalState::new(flags.clone())?;
|
||||
let cwd = std::env::current_dir().expect("No current directory");
|
||||
|
@ -462,7 +463,8 @@ async fn test_command(
|
|||
let test_file_path = cwd.join(".deno.test.ts");
|
||||
let test_file_url =
|
||||
Url::from_file_path(&test_file_path).expect("Should be valid file url");
|
||||
let test_file = test_runner::render_test_file(test_modules, fail_fast);
|
||||
let test_file =
|
||||
test_runner::render_test_file(test_modules, fail_fast, filter);
|
||||
let main_module =
|
||||
ModuleSpecifier::resolve_url(&test_file_url.to_string()).unwrap();
|
||||
let mut worker =
|
||||
|
@ -545,7 +547,10 @@ pub fn main() {
|
|||
fail_fast,
|
||||
include,
|
||||
allow_none,
|
||||
} => test_command(flags, include, fail_fast, allow_none).boxed_local(),
|
||||
filter,
|
||||
} => {
|
||||
test_command(flags, include, fail_fast, allow_none, filter).boxed_local()
|
||||
}
|
||||
DenoSubcommand::Completions { buf } => {
|
||||
if let Err(e) = write_to_stdout_ignore_sigpipe(&buf) {
|
||||
eprintln!("{}", e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue