diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-03-07 20:16:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-07 20:16:32 -0500 |
commit | 2dfc0aca7c6a04d54fe6f9a73be70fc4c591d552 (patch) | |
tree | 58fb01c46364e4888097e7135b2f829f38ce990c /tests/integration/lint_tests.rs | |
parent | 2ed984ba3aa638c3f088ac1edc5c779c7d9195d1 (diff) |
fix(publish): make include and exclude work (#22720)
1. Stops `deno publish` using some custom include/exclude behaviour from
other sub commands
2. Takes ancestor directories into account when resolving gitignore
3. Backards compatible change that adds ability to unexclude an exclude
by using a negated glob at a more specific level for all sub commands
(see https://github.com/denoland/deno_config/pull/44).
Diffstat (limited to 'tests/integration/lint_tests.rs')
-rw-r--r-- | tests/integration/lint_tests.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/integration/lint_tests.rs b/tests/integration/lint_tests.rs index ae0414262..a55fb1ef4 100644 --- a/tests/integration/lint_tests.rs +++ b/tests/integration/lint_tests.rs @@ -1,6 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use deno_core::serde_json::json; use test_util::assert_contains; +use test_util::assert_not_contains; use test_util::itest; use test_util::TestContextBuilder; @@ -252,3 +254,26 @@ itest!(no_slow_types_workspace { cwd: Some("lint/no_slow_types_workspace"), exit_code: 1, }); + +#[test] +fn opt_out_top_level_exclude_via_lint_unexclude() { + let context = TestContextBuilder::new().use_temp_cwd().build(); + let temp_dir = context.temp_dir().path(); + temp_dir.join("deno.json").write_json(&json!({ + "lint": { + "exclude": [ "!excluded.ts" ] + }, + "exclude": [ "excluded.ts", "actually_excluded.ts" ] + })); + + temp_dir.join("main.ts").write("const a = 1;"); + temp_dir.join("excluded.ts").write("const a = 2;"); + temp_dir.join("actually_excluded.ts").write("const a = 2;"); + + let output = context.new_command().arg("lint").run(); + output.assert_exit_code(1); + let output = output.combined_output(); + assert_contains!(output, "main.ts"); + assert_contains!(output, "excluded.ts"); + assert_not_contains!(output, "actually_excluded.ts"); +} |