From 89b61b5d05b7441d42e4e88fe1180d9d3dc1727e Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Tue, 4 May 2021 17:57:20 +0530 Subject: fix(cli): give context when failed to load import map (#10478) --- cli/tests/integration_tests.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cli/tests/integration_tests.rs') diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 5cbe00302..f2d1c1770 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -3841,6 +3841,17 @@ console.log("finish"); http_server: true, }); + // This test ensures that a descriptive error is shown when we're unable to load + // the import map. Even though this tests only the `run` subcommand, we can be sure + // that the error message is similar for other subcommands as they all use + // `program_state.maybe_import_map` to access the import map underneath. + itest!(error_import_map_unable_to_load { + args: + "run --import-map=import_maps/does_not_exist.json import_maps/test.ts", + output: "error_import_map_unable_to_load.out", + exit_code: 1, + }); + #[test] fn no_validate_asm() { let output = util::deno_cmd() -- cgit v1.2.3