summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/check_tests.rs7
-rw-r--r--cli/tests/integration/compile_tests.rs11
-rw-r--r--cli/tests/integration/info_tests.rs4
-rw-r--r--cli/tests/integration/jsr_tests.rs99
-rw-r--r--cli/tests/integration/mod.rs1
-rw-r--r--cli/tests/integration/npm_tests.rs22
-rw-r--r--cli/tests/integration/run_tests.rs16
-rw-r--r--cli/tests/testdata/jsr/deps/main.out13
-rw-r--r--cli/tests/testdata/jsr/deps/main.ts3
-rw-r--r--cli/tests/testdata/jsr/deps/main_info.out22
-rw-r--r--cli/tests/testdata/jsr/module_graph/main.out7
-rw-r--r--cli/tests/testdata/jsr/module_graph/main.ts3
-rw-r--r--cli/tests/testdata/jsr/module_graph/main_info.out14
-rw-r--r--cli/tests/testdata/jsr/no_module_graph/main.out6
-rw-r--r--cli/tests/testdata/jsr/no_module_graph/main.ts4
-rw-r--r--cli/tests/testdata/jsr/no_module_graph/main_info.out12
-rw-r--r--cli/tests/testdata/jsr/no_module_graph/multiple.out2
-rw-r--r--cli/tests/testdata/jsr/no_module_graph/multiple.ts5
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0/mod.ts7
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0_meta.json17
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/deps/meta.json5
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0/mod.ts5
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0/other.ts2
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0_meta.json13
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/module_graph/meta.json6
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0/TestClass.ts1
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0/mod.ts3
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0_meta.json1
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1/TestClass.ts1
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1/mod.ts3
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1_meta.json1
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0/TestClass.ts1
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0/mod.ts3
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0_meta.json1
-rw-r--r--cli/tests/testdata/jsr/registry/@denotest/no_module_graph/meta.json7
-rw-r--r--cli/tests/testdata/jsr/version_not_found/main.out4
-rw-r--r--cli/tests/testdata/jsr/version_not_found/main.ts2
37 files changed, 297 insertions, 37 deletions
diff --git a/cli/tests/integration/check_tests.rs b/cli/tests/integration/check_tests.rs
index 402f683c8..ca80ffa94 100644
--- a/cli/tests/integration/check_tests.rs
+++ b/cli/tests/integration/check_tests.rs
@@ -2,7 +2,6 @@
use test_util as util;
use util::env_vars_for_npm_tests;
-use util::env_vars_for_npm_tests_no_sync_download;
use util::TestContext;
use util::TestContextBuilder;
@@ -61,7 +60,7 @@ itest!(bundle_jsximportsource_importmap_config {
itest!(jsx_not_checked {
args: "check check/jsx_not_checked/main.jsx",
output: "check/jsx_not_checked/main.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
exit_code: 1,
});
@@ -272,7 +271,7 @@ itest!(package_json_basic {
itest!(package_json_fail_check {
args: "check --quiet fail_check.ts",
output: "package_json/basic/fail_check.check.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
cwd: Some("package_json/basic"),
copy_temp_dir: Some("package_json/basic"),
@@ -284,7 +283,7 @@ itest!(package_json_with_deno_json {
output: "package_json/deno_json/main.check.out",
cwd: Some("package_json/deno_json/"),
copy_temp_dir: Some("package_json/deno_json/"),
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
exit_code: 1,
});
diff --git a/cli/tests/integration/compile_tests.rs b/cli/tests/integration/compile_tests.rs
index f43b1cff9..657d17d7d 100644
--- a/cli/tests/integration/compile_tests.rs
+++ b/cli/tests/integration/compile_tests.rs
@@ -792,10 +792,7 @@ fn dynamic_import_unanalyzable() {
#[test]
fn compile_npm_specifiers() {
- let context = TestContextBuilder::for_npm()
- .use_sync_npm_download()
- .use_temp_cwd()
- .build();
+ let context = TestContextBuilder::for_npm().use_temp_cwd().build();
let temp_dir = context.temp_dir();
temp_dir.write(
@@ -1012,10 +1009,7 @@ struct RunNpmBinCompileOptions<'a> {
}
fn run_npm_bin_compile_test(opts: RunNpmBinCompileOptions) {
- let context = TestContextBuilder::for_npm()
- .use_sync_npm_download()
- .use_temp_cwd()
- .build();
+ let context = TestContextBuilder::for_npm().use_temp_cwd().build();
let temp_dir = context.temp_dir();
let testdata_path = context.testdata_path();
@@ -1066,7 +1060,6 @@ fn run_npm_bin_compile_test(opts: RunNpmBinCompileOptions) {
#[test]
fn compile_node_modules_symlink_outside() {
let context = TestContextBuilder::for_npm()
- .use_sync_npm_download()
.use_copy_temp_dir("compile/node_modules_symlink_outside")
.cwd("compile/node_modules_symlink_outside")
.build();
diff --git a/cli/tests/integration/info_tests.rs b/cli/tests/integration/info_tests.rs
index aeabf8208..bfba40080 100644
--- a/cli/tests/integration/info_tests.rs
+++ b/cli/tests/integration/info_tests.rs
@@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
use test_util as util;
-use util::env_vars_for_npm_tests_no_sync_download;
+use util::env_vars_for_npm_tests;
use util::TestContextBuilder;
#[test]
@@ -141,7 +141,7 @@ itest!(with_config_override {
itest!(package_json_basic {
args: "info --quiet main.ts",
output: "package_json/basic/main.info.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
cwd: Some("package_json/basic"),
copy_temp_dir: Some("package_json/basic"),
diff --git a/cli/tests/integration/jsr_tests.rs b/cli/tests/integration/jsr_tests.rs
new file mode 100644
index 000000000..d1706d84b
--- /dev/null
+++ b/cli/tests/integration/jsr_tests.rs
@@ -0,0 +1,99 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
+use deno_lockfile::Lockfile;
+use test_util as util;
+use util::env_vars_for_jsr_tests;
+use util::TestContextBuilder;
+
+itest!(no_module_graph_run {
+ args: "run jsr/no_module_graph/main.ts",
+ output: "jsr/no_module_graph/main.out",
+ envs: env_vars_for_jsr_tests(),
+ http_server: true,
+});
+
+itest!(no_module_graph_info {
+ args: "info jsr/no_module_graph/main.ts",
+ output: "jsr/no_module_graph/main_info.out",
+ envs: env_vars_for_jsr_tests(),
+ http_server: true,
+});
+
+itest!(same_package_multiple_versions {
+ args: "run --quiet jsr/no_module_graph/multiple.ts",
+ output: "jsr/no_module_graph/multiple.out",
+ envs: env_vars_for_jsr_tests(),
+ http_server: true,
+});
+
+itest!(module_graph_run {
+ args: "run jsr/module_graph/main.ts",
+ output: "jsr/module_graph/main.out",
+ envs: env_vars_for_jsr_tests(),
+ http_server: true,
+});
+
+itest!(module_graph_info {
+ args: "info jsr/module_graph/main.ts",
+ output: "jsr/module_graph/main_info.out",
+ envs: env_vars_for_jsr_tests(),
+ http_server: true,
+});
+
+itest!(deps_run {
+ args: "run jsr/deps/main.ts",
+ output: "jsr/deps/main.out",
+ envs: env_vars_for_jsr_tests(),
+ http_server: true,
+});
+
+itest!(deps_info {
+ args: "info jsr/deps/main.ts",
+ output: "jsr/deps/main_info.out",
+ envs: env_vars_for_jsr_tests(),
+ http_server: true,
+});
+
+itest!(version_not_found {
+ args: "run jsr/version_not_found/main.ts",
+ output: "jsr/version_not_found/main.out",
+ envs: env_vars_for_jsr_tests(),
+ http_server: true,
+ exit_code: 1,
+});
+
+#[test]
+fn specifiers_in_lockfile() {
+ let test_context = TestContextBuilder::for_jsr().use_temp_cwd().build();
+ let temp_dir = test_context.temp_dir();
+
+ temp_dir.write(
+ "main.ts",
+ r#"import version from "jsr:@denotest/no_module_graph@0.1/mod.ts";
+
+console.log(version);"#,
+ );
+ temp_dir.write("deno.json", "{}"); // to automatically create a lockfile
+
+ test_context
+ .new_command()
+ .args("run --quiet main.ts")
+ .run()
+ .assert_matches_text("0.1.1\n");
+
+ let lockfile_path = temp_dir.path().join("deno.lock");
+ let mut lockfile = Lockfile::new(lockfile_path.to_path_buf(), false).unwrap();
+ *lockfile
+ .content
+ .packages
+ .specifiers
+ .get_mut("jsr:@denotest/no_module_graph@0.1")
+ .unwrap() = "jsr:@denotest/no_module_graph@0.1.0".to_string();
+ lockfile_path.write(lockfile.as_json_string());
+
+ test_context
+ .new_command()
+ .args("run --quiet main.ts")
+ .run()
+ .assert_matches_text("0.1.0\n");
+}
diff --git a/cli/tests/integration/mod.rs b/cli/tests/integration/mod.rs
index 39a694c26..80b316432 100644
--- a/cli/tests/integration/mod.rs
+++ b/cli/tests/integration/mod.rs
@@ -121,6 +121,7 @@ mod inspector;
mod install;
#[path = "js_unit_tests.rs"]
mod js_unit_tests;
+mod jsr_tests;
#[path = "lint_tests.rs"]
mod lint;
#[path = "lsp_tests.rs"]
diff --git a/cli/tests/integration/npm_tests.rs b/cli/tests/integration/npm_tests.rs
index ff600637c..edd100d7d 100644
--- a/cli/tests/integration/npm_tests.rs
+++ b/cli/tests/integration/npm_tests.rs
@@ -8,7 +8,6 @@ use std::process::Stdio;
use test_util as util;
use util::assert_contains;
use util::env_vars_for_npm_tests;
-use util::env_vars_for_npm_tests_no_sync_download;
use util::http_server;
use util::TestContextBuilder;
@@ -461,7 +460,7 @@ fn parallel_downloading() {
],
None,
// don't use the sync env var
- Some(env_vars_for_npm_tests_no_sync_download()),
+ Some(env_vars_for_npm_tests()),
true,
);
assert!(out.contains("chalk cjs loads"));
@@ -742,7 +741,7 @@ fn deno_run_cjs_module() {
itest!(deno_run_cowsay {
args: "run -A --quiet npm:cowsay@1.5.0 Hello",
output: "npm/deno_run_cowsay.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
});
@@ -750,21 +749,21 @@ itest!(deno_run_cowsay_with_node_modules_dir {
args: "run -A --quiet --node-modules-dir npm:cowsay@1.5.0 Hello",
temp_cwd: true,
output: "npm/deno_run_cowsay.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
});
itest!(deno_run_cowsay_explicit {
args: "run -A --quiet npm:cowsay@1.5.0/cowsay Hello",
output: "npm/deno_run_cowsay.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
});
itest!(deno_run_cowthink {
args: "run -A --quiet npm:cowsay@1.5.0/cowthink Hello",
output: "npm/deno_run_cowthink.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
});
@@ -1553,7 +1552,6 @@ fn auto_discover_lock_file() {
#[test]
fn peer_deps_with_copied_folders_and_lockfile() {
let context = TestContextBuilder::for_npm()
- .use_sync_npm_download()
.use_copy_temp_dir("npm/peer_deps_with_copied_folders")
.cwd("npm/peer_deps_with_copied_folders")
.build();
@@ -1749,10 +1747,7 @@ fn reload_info_not_found_cache_but_exists_remote() {
// This tests that when a local machine doesn't have a version
// specified in a dependency that exists in the npm registry
- let test_context = TestContextBuilder::for_npm()
- .use_sync_npm_download()
- .use_temp_cwd()
- .build();
+ let test_context = TestContextBuilder::for_npm().use_temp_cwd().build();
let deno_dir = test_context.deno_dir();
let temp_dir = test_context.temp_dir();
temp_dir.write(
@@ -1955,7 +1950,6 @@ fn reload_info_not_found_cache_but_exists_remote() {
#[test]
fn binary_package_with_optional_dependencies() {
let context = TestContextBuilder::for_npm()
- .use_sync_npm_download()
.use_copy_temp_dir("npm/binary_package")
.cwd("npm/binary_package")
.build();
@@ -2171,7 +2165,7 @@ itest!(dynamic_import_json {
itest!(check_package_file_dts_dmts_dcts {
args: "check npm/file_dts_dmts_dcts/main.ts",
output: "npm/file_dts_dmts_dcts/main.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
exit_code: 1,
});
@@ -2179,7 +2173,7 @@ itest!(check_package_file_dts_dmts_dcts {
itest!(require_resolve_url_paths {
args: "run -A --quiet --node-modules-dir url_paths.ts",
output: "npm/require_resolve_url/url_paths.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
exit_code: 0,
cwd: Some("npm/require_resolve_url/"),
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs
index 0a5e86b1f..1dff1f6d6 100644
--- a/cli/tests/integration/run_tests.rs
+++ b/cli/tests/integration/run_tests.rs
@@ -15,7 +15,7 @@ use trust_dns_client::serialize::txt::Lexer;
use trust_dns_client::serialize::txt::Parser;
use util::assert_contains;
use util::assert_not_contains;
-use util::env_vars_for_npm_tests_no_sync_download;
+use util::env_vars_for_npm_tests;
use util::PathRef;
use util::TestContext;
use util::TestContextBuilder;
@@ -3122,7 +3122,7 @@ itest!(package_json_auto_discovered_for_local_script_arg {
cwd: Some("run/with_package_json/"),
// prevent creating a node_modules dir in the code directory
copy_temp_dir: Some("run/with_package_json/"),
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
});
@@ -3134,7 +3134,7 @@ itest!(
output: "run/with_package_json/with_stop/main.out",
cwd: Some("run/with_package_json/"),
copy_temp_dir: Some("run/with_package_json/"),
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
exit_code: 1,
}
@@ -3165,7 +3165,7 @@ itest!(
output: "run/with_package_json/no_deno_json/sub_dir/main.out",
cwd: Some("run/with_package_json/no_deno_json/sub_dir"),
copy_temp_dir: Some("run/with_package_json/no_deno_json/"),
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
}
);
@@ -3175,7 +3175,7 @@ itest!(package_json_auto_discovered_for_npm_binary {
output: "run/with_package_json/npm_binary/main.out",
cwd: Some("run/with_package_json/npm_binary/"),
copy_temp_dir: Some("run/with_package_json/"),
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
http_server: true,
});
@@ -4565,21 +4565,21 @@ fn permission_prompt_strips_ansi_codes_and_control_chars() {
itest!(node_builtin_modules_ts {
args: "run --quiet --allow-read run/node_builtin_modules/mod.ts hello there",
output: "run/node_builtin_modules/mod.ts.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
exit_code: 0,
});
itest!(node_builtin_modules_js {
args: "run --quiet --allow-read run/node_builtin_modules/mod.js hello there",
output: "run/node_builtin_modules/mod.js.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
exit_code: 0,
});
itest!(node_prefix_missing {
args: "run --quiet run/node_prefix_missing/main.ts",
output: "run/node_prefix_missing/main.ts.out",
- envs: env_vars_for_npm_tests_no_sync_download(),
+ envs: env_vars_for_npm_tests(),
exit_code: 1,
});
diff --git a/cli/tests/testdata/jsr/deps/main.out b/cli/tests/testdata/jsr/deps/main.out
new file mode 100644
index 000000000..388e1a6d5
--- /dev/null
+++ b/cli/tests/testdata/jsr/deps/main.out
@@ -0,0 +1,13 @@
+Download http://localhost:4545/jsr/registry/@denotest/deps/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/deps/1.0.0_meta.json
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0_meta.json
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.1_meta.json
+[UNORDERED_START]
+Download http://localhost:4545/jsr/registry/@denotest/deps/1.0.0/mod.ts
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0/other.ts
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.1/mod.ts
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.1/TestClass.ts
+[UNORDERED_END]
+{ version: "0.1.1", other: Other {} }
diff --git a/cli/tests/testdata/jsr/deps/main.ts b/cli/tests/testdata/jsr/deps/main.ts
new file mode 100644
index 000000000..25b13a681
--- /dev/null
+++ b/cli/tests/testdata/jsr/deps/main.ts
@@ -0,0 +1,3 @@
+import value from "jsr:@denotest/deps/mod.ts";
+
+console.log(value);
diff --git a/cli/tests/testdata/jsr/deps/main_info.out b/cli/tests/testdata/jsr/deps/main_info.out
new file mode 100644
index 000000000..c100e1363
--- /dev/null
+++ b/cli/tests/testdata/jsr/deps/main_info.out
@@ -0,0 +1,22 @@
+Download http://localhost:4545/jsr/registry/@denotest/deps/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/deps/1.0.0_meta.json
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0_meta.json
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.1_meta.json
+[UNORDERED_START]
+Download http://localhost:4545/jsr/registry/@denotest/deps/1.0.0/mod.ts
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0/other.ts
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.1/mod.ts
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.1/TestClass.ts
+[UNORDERED_END]
+local: [WILDCARD]main.ts
+type: TypeScript
+dependencies: 4 unique
+size: [WILDCARD]
+
+file:///[WILDCARD]main.ts ([WILDCARD])
+└─┬ http://localhost:4545/jsr/registry/@denotest/deps/1.0.0/mod.ts ([WILDCARD])
+ ├── http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0/other.ts ([WILDCARD])
+ └─┬ http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.1/mod.ts ([WILDCARD])
+ └── http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.1/TestClass.ts ([WILDCARD])
diff --git a/cli/tests/testdata/jsr/module_graph/main.out b/cli/tests/testdata/jsr/module_graph/main.out
new file mode 100644
index 000000000..c1c8d039d
--- /dev/null
+++ b/cli/tests/testdata/jsr/module_graph/main.out
@@ -0,0 +1,7 @@
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0_meta.json
+[UNORDERED_START]
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0/other.ts
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0/mod.ts
+[UNORDERED_END]
+Test { other: Other {} }
diff --git a/cli/tests/testdata/jsr/module_graph/main.ts b/cli/tests/testdata/jsr/module_graph/main.ts
new file mode 100644
index 000000000..02052595c
--- /dev/null
+++ b/cli/tests/testdata/jsr/module_graph/main.ts
@@ -0,0 +1,3 @@
+import { Test } from "jsr:@denotest/module_graph/mod.ts";
+
+console.log(new Test());
diff --git a/cli/tests/testdata/jsr/module_graph/main_info.out b/cli/tests/testdata/jsr/module_graph/main_info.out
new file mode 100644
index 000000000..4bb8388ed
--- /dev/null
+++ b/cli/tests/testdata/jsr/module_graph/main_info.out
@@ -0,0 +1,14 @@
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0_meta.json
+[UNORDERED_START]
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0/mod.ts
+Download http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0/other.ts
+[UNORDERED_END]
+local: [WILDCARD]main.ts
+type: TypeScript
+dependencies: 2 unique
+size: [WILDCARD]
+
+file:///[WILDCARD]/module_graph/main.ts ([WILDCARD])
+└─┬ http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0/mod.ts ([WILDCARD])
+ └── http://localhost:4545/jsr/registry/@denotest/module_graph/1.4.0/other.ts ([WILDCARD])
diff --git a/cli/tests/testdata/jsr/no_module_graph/main.out b/cli/tests/testdata/jsr/no_module_graph/main.out
new file mode 100644
index 000000000..70cae572d
--- /dev/null
+++ b/cli/tests/testdata/jsr/no_module_graph/main.out
@@ -0,0 +1,6 @@
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.0_meta.json
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.0/mod.ts
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.0/TestClass.ts
+0.1.0
+TestClass {}
diff --git a/cli/tests/testdata/jsr/no_module_graph/main.ts b/cli/tests/testdata/jsr/no_module_graph/main.ts
new file mode 100644
index 000000000..ab1e781dc
--- /dev/null
+++ b/cli/tests/testdata/jsr/no_module_graph/main.ts
@@ -0,0 +1,4 @@
+import version, { TestClass } from "jsr:@denotest/no_module_graph@0.1.0/mod.ts";
+
+console.log(version);
+console.log(new TestClass());
diff --git a/cli/tests/testdata/jsr/no_module_graph/main_info.out b/cli/tests/testdata/jsr/no_module_graph/main_info.out
new file mode 100644
index 000000000..282e0580c
--- /dev/null
+++ b/cli/tests/testdata/jsr/no_module_graph/main_info.out
@@ -0,0 +1,12 @@
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/meta.json
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.0_meta.json
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.0/mod.ts
+Download http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.0/TestClass.ts
+local: [WILDCARD]main.ts
+type: TypeScript
+dependencies: 2 unique
+size: [WILDCARD]
+
+file:///[WILDCARD]/jsr/no_module_graph/main.ts ([WILDCARD])
+└─┬ http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.0/mod.ts ([WILDCARD])
+ └── http://localhost:4545/jsr/registry/@denotest/no_module_graph/0.1.0/TestClass.ts ([WILDCARD])
diff --git a/cli/tests/testdata/jsr/no_module_graph/multiple.out b/cli/tests/testdata/jsr/no_module_graph/multiple.out
new file mode 100644
index 000000000..8146276d0
--- /dev/null
+++ b/cli/tests/testdata/jsr/no_module_graph/multiple.out
@@ -0,0 +1,2 @@
+0.1.0
+0.2.0
diff --git a/cli/tests/testdata/jsr/no_module_graph/multiple.ts b/cli/tests/testdata/jsr/no_module_graph/multiple.ts
new file mode 100644
index 000000000..0df32b780
--- /dev/null
+++ b/cli/tests/testdata/jsr/no_module_graph/multiple.ts
@@ -0,0 +1,5 @@
+import version1 from "jsr:@denotest/no_module_graph@0.1.0/mod.ts";
+import version2 from "jsr:@denotest/no_module_graph@^0.2/mod.ts";
+
+console.log(version1);
+console.log(version2);
diff --git a/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0/mod.ts b/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0/mod.ts
new file mode 100644
index 000000000..5b860b603
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0/mod.ts
@@ -0,0 +1,7 @@
+import { Other } from "jsr:@denotest/module_graph@1/other.ts";
+import version from "jsr:@denotest/no_module_graph@^0.1/mod.ts";
+
+export default {
+ version,
+ other: new Other(),
+};
diff --git a/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0_meta.json b/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0_meta.json
new file mode 100644
index 000000000..c6236b7df
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/deps/1.0.0_meta.json
@@ -0,0 +1,17 @@
+{
+ "moduleGraph1": {
+ "/mod.ts": {
+ "dependencies": [{
+ "kind": "import",
+ "range": [[0, 0], [0, 62]],
+ "specifier": "jsr:@denotest/module_graph@1/other.ts",
+ "specifierRange": [[0, 22], [0, 61]]
+ }, {
+ "kind": "import",
+ "range": [[1, 0], [1, 64]],
+ "specifier": "jsr:@denotest/no_module_graph@^0.1/mod.ts",
+ "specifierRange": [[1, 20], [1, 63]]
+ }]
+ }
+ }
+}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/deps/meta.json b/cli/tests/testdata/jsr/registry/@denotest/deps/meta.json
new file mode 100644
index 000000000..02601e4d0
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/deps/meta.json
@@ -0,0 +1,5 @@
+{
+ "versions": {
+ "1.0.0": {}
+ }
+}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0/mod.ts b/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0/mod.ts
new file mode 100644
index 000000000..cb3c4a5e0
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0/mod.ts
@@ -0,0 +1,5 @@
+import { Other } from "./other.ts";
+
+export class Test {
+ other = new Other();
+}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0/other.ts b/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0/other.ts
new file mode 100644
index 000000000..57e436cf8
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0/other.ts
@@ -0,0 +1,2 @@
+export class Other {
+}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0_meta.json b/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0_meta.json
new file mode 100644
index 000000000..d1e9a96b9
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/module_graph/1.4.0_meta.json
@@ -0,0 +1,13 @@
+{
+ "moduleGraph1": {
+ "/mod.ts": {
+ "dependencies": [{
+ "kind": "import",
+ "range": [[0, 0], [0, 35]],
+ "specifier": "./other.ts",
+ "specifierRange": [[0, 22], [0, 34]]
+ }]
+ },
+ "/other.ts": {}
+ }
+}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/module_graph/meta.json b/cli/tests/testdata/jsr/registry/@denotest/module_graph/meta.json
new file mode 100644
index 000000000..9a450c08b
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/module_graph/meta.json
@@ -0,0 +1,6 @@
+{
+ "versions": {
+ "1.0.0": {},
+ "1.4.0": {}
+ }
+}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0/TestClass.ts b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0/TestClass.ts
new file mode 100644
index 000000000..88ac04c12
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0/TestClass.ts
@@ -0,0 +1 @@
+export default class TestClass {}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0/mod.ts b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0/mod.ts
new file mode 100644
index 000000000..57600eb4b
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0/mod.ts
@@ -0,0 +1,3 @@
+export default "0.1.0";
+
+export { default as TestClass } from "./TestClass.ts";
diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0_meta.json b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0_meta.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.0_meta.json
@@ -0,0 +1 @@
+{}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1/TestClass.ts b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1/TestClass.ts
new file mode 100644
index 000000000..88ac04c12
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1/TestClass.ts
@@ -0,0 +1 @@
+export default class TestClass {}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1/mod.ts b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1/mod.ts
new file mode 100644
index 000000000..5e1fd9435
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1/mod.ts
@@ -0,0 +1,3 @@
+export default "0.1.1";
+
+export { default as TestClass } from "./TestClass.ts";
diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1_meta.json b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1_meta.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.1.1_meta.json
@@ -0,0 +1 @@
+{}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0/TestClass.ts b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0/TestClass.ts
new file mode 100644
index 000000000..88ac04c12
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0/TestClass.ts
@@ -0,0 +1 @@
+export default class TestClass {}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0/mod.ts b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0/mod.ts
new file mode 100644
index 000000000..edf9622fb
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0/mod.ts
@@ -0,0 +1,3 @@
+export default "0.2.0";
+
+export { default as TestClass } from "./TestClass.ts";
diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0_meta.json b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0_meta.json
new file mode 100644
index 000000000..0967ef424
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/0.2.0_meta.json
@@ -0,0 +1 @@
+{}
diff --git a/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/meta.json b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/meta.json
new file mode 100644
index 000000000..0268b6c8a
--- /dev/null
+++ b/cli/tests/testdata/jsr/registry/@denotest/no_module_graph/meta.json
@@ -0,0 +1,7 @@
+{
+ "versions": {
+ "0.1.0": {},
+ "0.1.1": {},
+ "0.2.0": {}
+ }
+}
diff --git a/cli/tests/testdata/jsr/version_not_found/main.out b/cli/tests/testdata/jsr/version_not_found/main.out
new file mode 100644
index 000000000..ec9a2ee96
--- /dev/null
+++ b/cli/tests/testdata/jsr/version_not_found/main.out
@@ -0,0 +1,4 @@
+Download http://localhost:4545/jsr/registry/@denotest/deps/meta.json
+error: Could not find constraint in the list of versions: @denotest/deps@0.1.4
+ Specifier: jsr:@denotest/deps@0.1.4/mod.ts
+ at file:///[WILDCARD]/version_not_found/main.ts:1:19
diff --git a/cli/tests/testdata/jsr/version_not_found/main.ts b/cli/tests/testdata/jsr/version_not_found/main.ts
new file mode 100644
index 000000000..a7673b744
--- /dev/null
+++ b/cli/tests/testdata/jsr/version_not_found/main.ts
@@ -0,0 +1,2 @@
+import value from "jsr:@denotest/deps@0.1.4/mod.ts";
+console.log(value);