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/test_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/test_tests.rs')
-rw-r--r-- | tests/integration/test_tests.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/integration/test_tests.rs b/tests/integration/test_tests.rs index cd85fd102..d5768b5ba 100644 --- a/tests/integration/test_tests.rs +++ b/tests/integration/test_tests.rs @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use deno_core::serde_json::json; use deno_core::url::Url; use test_util as util; use test_util::itest; @@ -668,3 +669,32 @@ itest!(test_include_relative_pattern_dot_slash { output: "test/relative_pattern_dot_slash/output.out", cwd: Some("test/relative_pattern_dot_slash"), }); + +#[test] +fn opt_out_top_level_exclude_via_test_unexclude() { + let context = TestContextBuilder::new().use_temp_cwd().build(); + let temp_dir = context.temp_dir().path(); + temp_dir.join("deno.json").write_json(&json!({ + "test": { + "exclude": [ "!excluded.test.ts" ] + }, + "exclude": [ "excluded.test.ts", "actually_excluded.test.ts" ] + })); + + temp_dir + .join("main.test.ts") + .write("Deno.test('test1', () => {});"); + temp_dir + .join("excluded.test.ts") + .write("Deno.test('test2', () => {});"); + temp_dir + .join("actually_excluded.test.ts") + .write("Deno.test('test3', () => {});"); + + let output = context.new_command().arg("test").run(); + output.assert_exit_code(0); + let output = output.combined_output(); + assert_contains!(output, "main.test.ts"); + assert_contains!(output, "excluded.test.ts"); + assert_not_contains!(output, "actually_excluded.test.ts"); +} |