fix(release): ignore leaf test filenames

This commit is contained in:
Gustavo Madeira Santana
2026-04-15 13:38:38 -04:00
parent 893d0635b6
commit 4dfcc030ae
2 changed files with 10 additions and 0 deletions

View File

@@ -134,6 +134,7 @@ function pathContainsPackedTestCargo(packedPath: string): boolean {
const segments = normalizedPath.split("/").filter(Boolean);
return segments.some(
(segment, index) =>
index < segments.length - 1 &&
PACKED_TEST_CARGO_DIRECTORY_SEGMENTS.has(segment) &&
!isNodeModulesPackageRoot(segments, index),
);

View File

@@ -416,6 +416,15 @@ describe("collectPackedTestCargoErrors", () => {
).toEqual([]);
});
it("allows leaf runtime filenames named test or tests", () => {
expect(
collectPackedTestCargoErrors([
"dist/extensions/fixture-plugin/node_modules/direct/bin/test",
"dist/extensions/fixture-plugin/node_modules/direct/bin/tests",
]),
).toEqual([]);
});
it("normalizes Windows or mixed separators before classifying test cargo", () => {
expect(
collectPackedTestCargoErrors([