diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-02-26 15:01:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-26 16:01:46 +0100 |
commit | eaad94687b8ed253362d9c0272840259306a2a38 (patch) | |
tree | d0a9470a3b2fe6497a381a5d6e37e5fc96f8ea63 | |
parent | 3f53b74e6dddcb1ec6312b22b8e5d2470f69679d (diff) |
test(publish): add a test that checks for .env files (#22590)
-rw-r--r-- | tests/integration/publish_tests.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/integration/publish_tests.rs b/tests/integration/publish_tests.rs index e8eda5010..e1626ae8d 100644 --- a/tests/integration/publish_tests.rs +++ b/tests/integration/publish_tests.rs @@ -363,6 +363,31 @@ fn includes_directories() { assert_not_contains!(output, "ignored.ts"); } +#[test] +fn includes_dotenv() { + 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(""); + temp_dir.join(".env").write("FOO=BAR"); + + let output = context + .new_command() + .arg("publish") + .arg("--token") + .arg("sadfasdf") + .run(); + output.assert_exit_code(0); + let output = output.combined_output(); + assert_contains!(output, "main.ts"); + assert_not_contains!(output, ".env"); +} + fn publish_context_builder() -> TestContextBuilder { TestContextBuilder::new() .use_http_server() |