diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-05-31 01:20:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 10:20:34 +1000 |
commit | 3a33510bd4a169aba00393c2b7e88bf7fa0cad06 (patch) | |
tree | 37320e072cb142a90017e9c0709eb88dd77670ef /cli/tests | |
parent | 83ce33363347447e25d2d00732dad86b588b89f0 (diff) |
fix(cli): Don't statically error on dynamic unmapped bare specifiers (#10618)
Fixes #10168
Fixes #10615
Fixes #10616
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/092_import_map_unmapped_bare_specifier.ts | 1 | ||||
-rw-r--r-- | cli/tests/092_import_map_unmapped_bare_specifier.ts.out | 4 | ||||
-rw-r--r-- | cli/tests/error_011_bad_module_specifier.ts.out | 2 | ||||
-rw-r--r-- | cli/tests/error_012_bad_dynamic_import_specifier.ts.out | 2 | ||||
-rw-r--r-- | cli/tests/error_014_catch_dynamic_import_error.js.out | 4 | ||||
-rw-r--r-- | cli/tests/error_type_definitions.ts.out | 2 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 6 |
7 files changed, 16 insertions, 5 deletions
diff --git a/cli/tests/092_import_map_unmapped_bare_specifier.ts b/cli/tests/092_import_map_unmapped_bare_specifier.ts new file mode 100644 index 000000000..87684430d --- /dev/null +++ b/cli/tests/092_import_map_unmapped_bare_specifier.ts @@ -0,0 +1 @@ +await import("unmapped"); diff --git a/cli/tests/092_import_map_unmapped_bare_specifier.ts.out b/cli/tests/092_import_map_unmapped_bare_specifier.ts.out new file mode 100644 index 000000000..1a55e352b --- /dev/null +++ b/cli/tests/092_import_map_unmapped_bare_specifier.ts.out @@ -0,0 +1,4 @@ +[WILDCARD]error: Uncaught (in promise) TypeError: Relative import path "unmapped" not prefixed with / or ./ or ../ and not in import map from "[WILDCARD]" +await import("unmapped"); +^ + at [WILDCARD] diff --git a/cli/tests/error_011_bad_module_specifier.ts.out b/cli/tests/error_011_bad_module_specifier.ts.out index e6f9b2321..713072191 100644 --- a/cli/tests/error_011_bad_module_specifier.ts.out +++ b/cli/tests/error_011_bad_module_specifier.ts.out @@ -1 +1 @@ -[WILDCARD]error: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_011_bad_module_specifier.ts" +[WILDCARD]error: Relative import path "bad-module.ts" not prefixed with / or ./ or ../ from "[WILDCARD]/error_011_bad_module_specifier.ts" diff --git a/cli/tests/error_012_bad_dynamic_import_specifier.ts.out b/cli/tests/error_012_bad_dynamic_import_specifier.ts.out index 45bce8261..0d0b168a4 100644 --- a/cli/tests/error_012_bad_dynamic_import_specifier.ts.out +++ b/cli/tests/error_012_bad_dynamic_import_specifier.ts.out @@ -1,5 +1,5 @@ Check [WILDCARD]error_012_bad_dynamic_import_specifier.ts -error: Uncaught (in promise) TypeError: relative import path "bad-module.ts" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_012_bad_dynamic_import_specifier.ts" +error: Uncaught (in promise) TypeError: Relative import path "bad-module.ts" not prefixed with / or ./ or ../ from "[WILDCARD]/error_012_bad_dynamic_import_specifier.ts" const _badModule = await import("bad-module.ts"); ^ at async file:///[WILDCARD]/error_012_bad_dynamic_import_specifier.ts:2:22 diff --git a/cli/tests/error_014_catch_dynamic_import_error.js.out b/cli/tests/error_014_catch_dynamic_import_error.js.out index 4f133c834..60de400db 100644 --- a/cli/tests/error_014_catch_dynamic_import_error.js.out +++ b/cli/tests/error_014_catch_dynamic_import_error.js.out @@ -1,8 +1,8 @@ Caught direct dynamic import error. -TypeError: relative import path "does not exist" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/error_014_catch_dynamic_import_error.js" +TypeError: Relative import path "does not exist" not prefixed with / or ./ or ../ from "[WILDCARD]/error_014_catch_dynamic_import_error.js" at async file:///[WILDCARD]/error_014_catch_dynamic_import_error.js:3:5 Caught indirect direct dynamic import error. -TypeError: relative import path "does not exist either" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/indirect_import_error.js" +TypeError: Relative import path "does not exist either" not prefixed with / or ./ or ../ from "[WILDCARD]/indirect_import_error.js" at async file:///[WILDCARD]/error_014_catch_dynamic_import_error.js:10:5 Caught error thrown by dynamically imported module. Error: An error diff --git a/cli/tests/error_type_definitions.ts.out b/cli/tests/error_type_definitions.ts.out index 32c3c9b52..304ec1bdf 100644 --- a/cli/tests/error_type_definitions.ts.out +++ b/cli/tests/error_type_definitions.ts.out @@ -1 +1 @@ -[WILDCARD]error: relative import path "baz" not prefixed with / or ./ or ../ Imported from "[WILDCARD]/type_definitions/bar.d.ts" +[WILDCARD]error: Relative import path "baz" not prefixed with / or ./ or ../ from "[WILDCARD]/type_definitions/bar.d.ts" diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 5188c60ba..5af533dab 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -3133,6 +3133,12 @@ console.log("finish"); exit_code: 1, }); + itest!(_092_import_map_unmapped_bare_specifier { + args: "run --import-map import_maps/import_map.json 092_import_map_unmapped_bare_specifier.ts", + output: "092_import_map_unmapped_bare_specifier.ts.out", + exit_code: 1, + }); + itest!(dynamic_import_permissions_remote_remote { args: "run --quiet --reload --allow-net=localhost:4545 dynamic_import/permissions_remote_remote.ts", output: "dynamic_import/permissions_remote_remote.ts.out", |