diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-03-09 20:40:53 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-09 20:40:53 -0500 |
commit | f8543a9fd8d47753a607dfc04c121c49d1ac4294 (patch) | |
tree | d912fc131909df44fba20e368010b5bab858ef6d /tests | |
parent | dff056ae41011104586b60d5e47ded502e60db11 (diff) |
fix(publish): regression - publishing with vendor folder (#22830)
In
https://github.com/denoland/deno/pull/22720/files#diff-d62d85de2a7ffb816cd2fdbaa47e588352f521c7c43d058b75649bbb255e0ae1R70
, I copy and pasted from another area of the code and didn't think about
removing how it ignores the vendor folder by default.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/publish_tests.rs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/integration/publish_tests.rs b/tests/integration/publish_tests.rs index a590e02ad..f6ee1b371 100644 --- a/tests/integration/publish_tests.rs +++ b/tests/integration/publish_tests.rs @@ -589,6 +589,46 @@ fn not_includes_gitignored_dotenv() { assert_not_contains!(output, ".env"); } +#[test] +fn not_includes_vendor_dir_only_when_vendor_true() { + 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": "./main.ts", + })); + + temp_dir.join("main.ts").write(""); + let vendor_folder = temp_dir.join("vendor"); + vendor_folder.create_dir_all(); + vendor_folder.join("vendor.ts").write(""); + + let publish_cmd = context.new_command().args("publish --dry-run"); + { + let output = publish_cmd.run(); + output.assert_exit_code(0); + let output = output.combined_output(); + assert_contains!(output, "main.ts"); + assert_contains!(output, "vendor.ts"); + } + + // with vendor + { + temp_dir.join("deno.json").write_json(&json!({ + "name": "@foo/bar", + "version": "1.0.0", + "exports": "./main.ts", + "vendor": true, + })); + let output = publish_cmd.run(); + output.assert_exit_code(0); + let output = output.combined_output(); + assert_contains!(output, "main.ts"); + assert_not_contains!(output, "vendor.ts"); + } +} + fn publish_context_builder() -> TestContextBuilder { TestContextBuilder::new() .use_http_server() |