diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-11-10 10:10:41 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 10:10:41 +1100 |
commit | c1fa8fbeba7bb9a35d144af3ae9d483c2baf4c76 (patch) | |
tree | aae4e3af2bfc63e9b69b8db35a4e168bc6f102b1 /cli/module_graph.rs | |
parent | 568b7d6afb43d7f501d1baf14d5a10470541bba2 (diff) |
fix(cli): allow root modules be .mjs/.cjs (#8310)
Fixes #6176
Diffstat (limited to 'cli/module_graph.rs')
-rw-r--r-- | cli/module_graph.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/module_graph.rs b/cli/module_graph.rs index 493bc2dc4..bf3972904 100644 --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -2008,6 +2008,27 @@ pub mod tests { } #[tokio::test] + async fn fix_graph_check_mjs_root() { + let specifier = ModuleSpecifier::resolve_url_or_path("file:///tests/a.mjs") + .expect("could not resolve module"); + let (graph, handler) = setup(specifier).await; + let result_info = graph + .check(CheckOptions { + debug: false, + emit: true, + lib: TypeLib::DenoWindow, + maybe_config_path: None, + reload: false, + }) + .expect("should have checked"); + assert!(result_info.maybe_ignored_options.is_none()); + assert!(result_info.diagnostics.is_empty()); + let h = handler.borrow(); + assert_eq!(h.cache_calls.len(), 1); + assert_eq!(h.tsbuildinfo_calls.len(), 1); + } + + #[tokio::test] async fn fix_graph_check_types_root() { let specifier = ModuleSpecifier::resolve_url_or_path("file:///typesref.js") .expect("could not resolve module"); |