diff options
| author | Vedant Pandey <vedantpandey46@gmail.com> | 2023-07-25 21:53:43 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-25 18:23:43 +0200 |
| commit | 4a5aaceb26cb7441d0702d30961e0059256826b7 (patch) | |
| tree | 50b157a21bcf09ec9ab48d0ef86fa598193a39c0 /cli/tests | |
| parent | bd79baea5e6734ab70802cd2c2532a491a987ff7 (diff) | |
fix: deno info should respect import map (#19781)
Closes #19742
Diffstat (limited to 'cli/tests')
| -rw-r--r-- | cli/tests/integration/info_tests.rs | 7 | ||||
| -rw-r--r-- | cli/tests/testdata/info/with_import_map/deno.json | 6 | ||||
| -rw-r--r-- | cli/tests/testdata/info/with_import_map/deno.lock | 7 | ||||
| -rw-r--r-- | cli/tests/testdata/info/with_import_map/main.tsx | 2 | ||||
| -rw-r--r-- | cli/tests/testdata/info/with_import_map/with_import_map.out | 16 |
5 files changed, 38 insertions, 0 deletions
diff --git a/cli/tests/integration/info_tests.rs b/cli/tests/integration/info_tests.rs index 856d92f9f..aeabf8208 100644 --- a/cli/tests/integration/info_tests.rs +++ b/cli/tests/integration/info_tests.rs @@ -147,3 +147,10 @@ itest!(package_json_basic { copy_temp_dir: Some("package_json/basic"), exit_code: 0, }); + +itest!(info_import_map { + args: "info preact/debug", + output: "info/with_import_map/with_import_map.out", + cwd: Some("info/with_import_map"), + exit_code: 0, +}); diff --git a/cli/tests/testdata/info/with_import_map/deno.json b/cli/tests/testdata/info/with_import_map/deno.json new file mode 100644 index 000000000..aaf7260c6 --- /dev/null +++ b/cli/tests/testdata/info/with_import_map/deno.json @@ -0,0 +1,6 @@ +{ + "imports": { + "preact": "https://esm.sh/preact@10.15.1", + "preact/": "https://esm.sh/preact@10.15.1/" + } +} diff --git a/cli/tests/testdata/info/with_import_map/deno.lock b/cli/tests/testdata/info/with_import_map/deno.lock new file mode 100644 index 000000000..78080ede2 --- /dev/null +++ b/cli/tests/testdata/info/with_import_map/deno.lock @@ -0,0 +1,7 @@ +{ + "version": "2", + "remote": { + "https://esm.sh/preact@10.15.1": "2b79349676a4942fbcf835c4efa909791c2f0aeca195225bf22bac9866e94b4e", + "https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs": "30710ac1d5ff3711ae0c04eddbeb706f34f82d97489f61aaf09897bc75d2a628" + } +} diff --git a/cli/tests/testdata/info/with_import_map/main.tsx b/cli/tests/testdata/info/with_import_map/main.tsx new file mode 100644 index 000000000..e38f14a58 --- /dev/null +++ b/cli/tests/testdata/info/with_import_map/main.tsx @@ -0,0 +1,2 @@ +import { render } from "preact"; +console.log(render); diff --git a/cli/tests/testdata/info/with_import_map/with_import_map.out b/cli/tests/testdata/info/with_import_map/with_import_map.out new file mode 100644 index 000000000..29dc17737 --- /dev/null +++ b/cli/tests/testdata/info/with_import_map/with_import_map.out @@ -0,0 +1,16 @@ +Download https://esm.sh/preact@10.15.1/debug +Download https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs +Download https://esm.sh/stable/preact@10.15.1/denonext/devtools.js +Download https://esm.sh/stable/preact@10.15.1/denonext/debug.js +local: [WILDCARD] +type: JavaScript +dependencies: 3 unique +size: [WILDCARD] + +https://esm.sh/preact@10.15.1/debug [WILDCARD] +├── https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs [WILDCARD] +├─┬ https://esm.sh/stable/preact@10.15.1/denonext/devtools.js [WILDCARD] +│ └── https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs [WILDCARD] +└─┬ https://esm.sh/stable/preact@10.15.1/denonext/debug.js [WILDCARD] + ├── https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs [WILDCARD] + └── https://esm.sh/stable/preact@10.15.1/denonext/devtools.js [WILDCARD] |
