Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(publish): add a test that checks for .env files #22590

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/integration/publish_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check that this log of main.ts isn't from the Check ... line?

I don't think we print out files we're publishing outside of dry-run or -Ldebug

assert_not_contains!(output, ".env");
}

fn publish_context_builder() -> TestContextBuilder {
TestContextBuilder::new()
.use_http_server()
Expand Down