diff options
-rw-r--r-- | cli/flags.rs | 23 | ||||
-rw-r--r-- | cli/tests/065_import_map_info.out | 5 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 6 |
3 files changed, 34 insertions, 0 deletions
diff --git a/cli/flags.rs b/cli/flags.rs index 4d08b0c77..63d4c15e0 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -478,6 +478,7 @@ fn eval_parse(flags: &mut Flags, matches: &clap::ArgMatches) { fn info_parse(flags: &mut Flags, matches: &clap::ArgMatches) { reload_arg_parse(flags, matches); + importmap_arg_parse(flags, matches); ca_file_arg_parse(flags, matches); let json = matches.is_present("json"); flags.subcommand = DenoSubcommand::Info { @@ -884,6 +885,7 @@ TypeScript compiler cache: Subdirectory containing TS compiler output.", .arg(ca_file_arg()) // TODO(lucacasonato): remove for 2.0 .arg(no_check_arg().hidden(true)) + .arg(importmap_arg()) .arg( Arg::with_name("json") .long("json") @@ -2376,6 +2378,27 @@ mod tests { } #[test] + fn info_importmap() { + let r = flags_from_vec_safe(svec![ + "deno", + "info", + "--importmap=importmap.json", + "script.ts" + ]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Info { + file: Some("script.ts".to_string()), + json: false, + }, + import_map_path: Some("importmap.json".to_owned()), + ..Flags::default() + } + ); + } + + #[test] fn cache_importmap() { let r = flags_from_vec_safe(svec![ "deno", diff --git a/cli/tests/065_import_map_info.out b/cli/tests/065_import_map_info.out new file mode 100644 index 000000000..5407b7d80 --- /dev/null +++ b/cli/tests/065_import_map_info.out @@ -0,0 +1,5 @@ +[WILDCARD] +local: [WILDCARD]test.ts +type: TypeScript +deps: 7 unique (total [WILDCARD]) +[WILDCARD] diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 389afdea3..a03dc7dc4 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1711,6 +1711,12 @@ itest!(_064_permissions_revoke_global { output: "064_permissions_revoke_global.ts.out", }); +itest!(_065_import_map_info { + args: + "info --quiet --importmap=importmaps/import_map.json --unstable importmaps/test.ts", + output: "065_import_map_info.out", +}); + itest!(js_import_detect { args: "run --quiet --reload js_import_detect.ts", output: "js_import_detect.ts.out", |