summaryrefslogtreecommitdiff
path: root/tests/integration/publish_tests.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-08-12 19:51:58 -0400
committerGitHub <noreply@github.com>2024-08-12 19:51:58 -0400
commit39a21fd78eb6d9a13d46d108af35c58a3f550332 (patch)
tree0fb56fc064be968506d4ccb4798fabf178e29ca3 /tests/integration/publish_tests.rs
parent631e175498203294f474031d169354d1cf648ca8 (diff)
feat(publish): error on missing license file (#25011)
Closes https://github.com/denoland/deno/issues/24676
Diffstat (limited to 'tests/integration/publish_tests.rs')
-rw-r--r--tests/integration/publish_tests.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/integration/publish_tests.rs b/tests/integration/publish_tests.rs
index 013bf3973..b97479e78 100644
--- a/tests/integration/publish_tests.rs
+++ b/tests/integration/publish_tests.rs
@@ -22,6 +22,7 @@ fn publish_non_exported_files_using_import_map() {
"@denotest/add": "jsr:@denotest/add@1"
}
}));
+ temp_dir.join("LICENSE").write("");
// file not in the graph
let other_ts = temp_dir.join("_other.ts");
other_ts
@@ -52,6 +53,7 @@ fn publish_warning_not_in_graph() {
"version": "1.0.0",
"exports": "./mod.ts",
}));
+ temp_dir.join("LICENSE").write("");
// file not in the graph that uses a non-analyzable dynamic import (cause a diagnostic)
let other_ts = temp_dir.join("_other.ts");
other_ts
@@ -92,6 +94,7 @@ fn ignores_gitignore() {
"version": "1.0.0",
"exports": "./main.ts"
}));
+ temp_dir.join("LICENSE").write("");
temp_dir.join("main.ts").write("import './sub_dir/b.ts';");
@@ -151,6 +154,7 @@ fn ignores_directories() {
sub_dir.join("sub_included.ts").write("");
temp_dir.join("main_included.ts").write("");
+ temp_dir.join("LICENSE").write("");
let output = context
.new_command()
@@ -185,6 +189,7 @@ fn not_include_gitignored_file_unless_exact_match_in_include() {
]
}
}));
+ temp_dir.join("LICENSE").write("");
temp_dir
.join(".gitignore")
@@ -217,7 +222,7 @@ fn not_include_gitignored_file_unless_exact_match_in_include() {
}
#[test]
-fn gitignore_everything_exlcuded_override() {
+fn gitignore_everything_excluded_override() {
let context = publish_context_builder().build();
let temp_dir = context.temp_dir().path();
@@ -232,6 +237,7 @@ fn gitignore_everything_exlcuded_override() {
"exclude": ["!**"]
}
}));
+ temp_dir.join("LICENSE").write("");
temp_dir.join("root_main.ts").write("");
let sub_dir = temp_dir.join("sub");
@@ -257,6 +263,7 @@ fn includes_directories_with_gitignore_when_unexcluded() {
"exclude": [ "!ignored.ts" ]
}
}));
+ temp_dir.join("LICENSE").write("");
temp_dir.join(".gitignore").write("ignored.ts");
temp_dir.join("main.ts").write("");
@@ -284,6 +291,7 @@ fn includes_unexcluded_sub_dir() {
]
}
}));
+ temp_dir.join("LICENSE").write("");
temp_dir.join("included1.ts").write("");
temp_dir.join("ignored/unexcluded").create_dir_all();
@@ -310,6 +318,7 @@ fn includes_directories() {
"include": [ "deno.json", "main.ts" ]
}
}));
+ temp_dir.join("LICENSE").write("");
temp_dir.join("main.ts").write("");
temp_dir.join("ignored.ts").write("");
@@ -335,6 +344,7 @@ fn not_includes_gitignored_dotenv() {
"version": "1.0.0",
"exports": "./main.ts",
}));
+ temp_dir.join("LICENSE").write("");
temp_dir.join("main.ts").write("");
temp_dir.join(".env").write("FOO=BAR");
@@ -356,6 +366,7 @@ fn not_includes_vendor_dir_only_when_vendor_true() {
"version": "1.0.0",
"exports": "./main.ts",
}));
+ temp_dir.join("LICENSE").write("");
temp_dir.join("main.ts").write("");
let vendor_folder = temp_dir.join("vendor");
@@ -396,9 +407,9 @@ fn allow_dirty() {
"version": "1.0.0",
"exports": "./main.ts",
}));
+ temp_dir.join("LICENSE").write("");
temp_dir.join("main.ts").write("");
- temp_dir.join("LICENSE").write("");
let cmd = Command::new("git")
.arg("init")
@@ -447,6 +458,7 @@ fn allow_dirty_not_in_repo() {
"version": "1.0.0",
"exports": "./main.ts",
}));
+ temp_dir.join("LICENSE").write("");
temp_dir.join("main.ts").write("");
// At this point there are untracked files, but we're not in Git repo,
@@ -472,6 +484,7 @@ fn allow_dirty_dry_run() {
"version": "1.0.0",
"exports": "./main.ts",
}));
+ temp_dir.join("LICENSE").write("");
temp_dir.join("main.ts").write("");