diff options
author | Liam Murphy <liampm32@gmail.com> | 2021-05-10 16:06:13 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-10 08:06:13 +0200 |
commit | 7a9ebd15852eee7b676a671098d63bece679e0f7 (patch) | |
tree | 188c5b64a0a30f6c62382aef80b32eec98d91bc1 /cli/flags.rs | |
parent | 84733d90c7cf9b6768acf78f4204b2293f2d1bc0 (diff) |
feat: add deno test --watch (#9160)
This commit implements file watching for deno test.
When a file is changed, only the test modules which
use it as a dependency are rerun.
This is accomplished by reworking the file watching infrastructure
to pass the paths which have changed to the resolver, and then
constructing a module graph for each test module to check if it
contains any changed files.
Diffstat (limited to 'cli/flags.rs')
-rw-r--r-- | cli/flags.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/flags.rs b/cli/flags.rs index 0c916ecb8..6f23afba1 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -1031,6 +1031,11 @@ fn test_subcommand<'a, 'b>() -> App<'a, 'b> { .takes_value(true) .multiple(true), ) + .arg( + watch_arg() + .conflicts_with("no-run") + .conflicts_with("coverage"), + ) .arg(script_arg().last(true)) .about("Run tests") .long_about( @@ -1667,6 +1672,8 @@ fn test_parse(flags: &mut Flags, matches: &clap::ArgMatches) { let quiet = matches.is_present("quiet"); let filter = matches.value_of("filter").map(String::from); + flags.watch = matches.is_present("watch"); + if matches.is_present("script_arg") { let script_arg: Vec<String> = matches .values_of("script_arg") |