summaryrefslogtreecommitdiff
path: root/cli/tests/integration/publish_tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/integration/publish_tests.rs')
-rw-r--r--cli/tests/integration/publish_tests.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/cli/tests/integration/publish_tests.rs b/cli/tests/integration/publish_tests.rs
index dbbbe1912..b15ca5f89 100644
--- a/cli/tests/integration/publish_tests.rs
+++ b/cli/tests/integration/publish_tests.rs
@@ -66,6 +66,37 @@ itest!(invalid_import {
http_server: true,
});
+#[test]
+fn publish_non_exported_files_using_import_map() {
+ let context = publish_context_builder().build();
+ let temp_dir = context.temp_dir().path();
+ temp_dir.join("deno.json").write_json(&json!({
+ "name": "@foo/bar",
+ "version": "1.0.0",
+ "exports": "./mod.ts",
+ "imports": {
+ "@denotest/add": "jsr:@denotest/add@1"
+ }
+ }));
+ // file not in the graph
+ let other_ts = temp_dir.join("_other.ts");
+ other_ts
+ .write("import { add } from '@denotest/add'; console.log(add(1, 3));");
+ let mod_ts = temp_dir.join("mod.ts");
+ mod_ts.write("import { add } from '@denotest/add'; console.log(add(1, 2));");
+ let output = context
+ .new_command()
+ .args("publish --log-level=debug --token 'sadfasdf'")
+ .run();
+ let lines = output.combined_output().split('\n').collect::<Vec<_>>();
+ assert!(lines
+ .iter()
+ .any(|l| l.contains("Unfurling") && l.ends_with("mod.ts")));
+ assert!(lines
+ .iter()
+ .any(|l| l.contains("Unfurling") && l.ends_with("other.ts")));
+}
+
itest!(javascript_missing_decl_file {
args: "publish --token 'sadfasdf'",
output: "publish/javascript_missing_decl_file.out",