diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-02-06 15:57:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-06 15:57:10 -0500 |
commit | c6def993e052626be3933de4299bf4b2eb76e48a (patch) | |
tree | d377208be4e20bbefb51adb85e546a6f0e65c43b /cli/tests/integration/publish_tests.rs | |
parent | a6b2a4474e50952f28cb933ada0d698fc1055578 (diff) |
fix(publish): lazily parse sources (#22301)
Closes #22290
Diffstat (limited to 'cli/tests/integration/publish_tests.rs')
-rw-r--r-- | cli/tests/integration/publish_tests.rs | 31 |
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", |