diff options
author | KrisChambers <Kris.chambers@outlook.com> | 2020-09-07 09:59:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-07 15:59:47 +0200 |
commit | 1cd226750065e6101c0a38694ff9f96a40b437d0 (patch) | |
tree | 846632d932c7a7584f3e00d4fed8cd358be75aa8 /cli/tests/integration_tests.rs | |
parent | 7a8b27aa25b419a9daef976793c59bd22d35551a (diff) |
feat(info): Dependency count and sizes (#6786)
This commit changes "deno info" subcommand logic.
- Modules are no longer loaded into V8 isolate - analysis
is done using ModuleGraph.
- Removed deno_core::Deps structure.
- Modules are no longer type-checked and transpiled -
"compiled" file is shown only if it is already available.
- Added number of unique dependencies for root module.
- Changed tree output:
- file size is shown next to the dependency
- repeated dependencies are marked with "*"
- used less spaces in prefix to save terminal width
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r-- | cli/tests/integration_tests.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 94d410dcc..4b1b67f7f 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -950,6 +950,38 @@ fn bundle_import_map() { } #[test] +fn info_with_compiled_source() { + let _g = util::http_server(); + let module_path = "http://127.0.0.1:4545/cli/tests/048_media_types_jsx.ts"; + let t = TempDir::new().expect("tempdir fail"); + + let mut deno = util::deno_cmd() + .env("DENO_DIR", t.path()) + .current_dir(util::root_path()) + .arg("cache") + .arg(&module_path) + .spawn() + .expect("failed to spawn script"); + let status = deno.wait().expect("failed to wait for the child process"); + assert!(status.success()); + + let output = util::deno_cmd() + .env("DENO_DIR", t.path()) + .env("NO_COLOR", "1") + .current_dir(util::root_path()) + .arg("info") + .arg(&module_path) + .output() + .expect("failed to spawn script"); + + let str_output = std::str::from_utf8(&output.stdout).unwrap().trim(); + eprintln!("{}", str_output); + // check the output of the test.ts program. + assert!(str_output.contains("compiled: ")); + assert_eq!(output.stderr, b""); +} + +#[test] fn repl_test_console_log() { let (out, err) = util::run_and_collect_output( true, @@ -2289,6 +2321,12 @@ itest!(import_file_with_colon { http_server: true, }); +itest!(info_recursive_modules { + args: "info --quiet info_recursive_imports_test.ts", + output: "info_recursive_imports_test.out", + exit_code: 0, +}); + itest!(info_type_import { args: "info info_type_import.ts", output: "info_type_import.out", |