mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
test(publish): add a test that checks for .env files (#22590)
This commit is contained in:
parent
3f53b74e6d
commit
eaad94687b
1 changed files with 25 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue