diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-11-10 10:18:43 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 10:18:43 +1100 |
commit | 0982056ff64368451c38b622de90f62fbade89fd (patch) | |
tree | 984641158c0d641a158478e03f6d18a8c76e223a | |
parent | c1fa8fbeba7bb9a35d144af3ae9d483c2baf4c76 (diff) |
tests(cli): check ignores dynamic import errors (#8323)
Closes #6618
-rw-r--r-- | cli/module_graph.rs | 18 | ||||
-rw-r--r-- | cli/tests/module_graph/file_tests-dynamicimport.ts | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/cli/module_graph.rs b/cli/module_graph.rs index bf3972904..0bd51251f 100644 --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -1960,6 +1960,24 @@ pub mod tests { } #[tokio::test] + async fn test_graph_check_ignores_dynamic_import_errors() { + let specifier = + ModuleSpecifier::resolve_url_or_path("file:///tests/dynamicimport.ts") + .expect("could not resolve module"); + let (graph, _) = setup(specifier).await; + let result_info = graph + .check(CheckOptions { + debug: false, + emit: false, + lib: TypeLib::DenoWindow, + maybe_config_path: None, + reload: false, + }) + .expect("should have checked"); + assert!(result_info.diagnostics.is_empty()); + } + + #[tokio::test] async fn fix_graph_check_emit_diagnostics() { let specifier = ModuleSpecifier::resolve_url_or_path("file:///tests/diag.ts") diff --git a/cli/tests/module_graph/file_tests-dynamicimport.ts b/cli/tests/module_graph/file_tests-dynamicimport.ts new file mode 100644 index 000000000..b5c9f080f --- /dev/null +++ b/cli/tests/module_graph/file_tests-dynamicimport.ts @@ -0,0 +1,5 @@ +try { + await import("bare_module_specifier"); +} catch (err) { + console.log(err); +} |