fix(release): ignore leaf test filenames
This commit is contained in:
@@ -134,6 +134,7 @@ function pathContainsPackedTestCargo(packedPath: string): boolean {
|
|||||||
const segments = normalizedPath.split("/").filter(Boolean);
|
const segments = normalizedPath.split("/").filter(Boolean);
|
||||||
return segments.some(
|
return segments.some(
|
||||||
(segment, index) =>
|
(segment, index) =>
|
||||||
|
index < segments.length - 1 &&
|
||||||
PACKED_TEST_CARGO_DIRECTORY_SEGMENTS.has(segment) &&
|
PACKED_TEST_CARGO_DIRECTORY_SEGMENTS.has(segment) &&
|
||||||
!isNodeModulesPackageRoot(segments, index),
|
!isNodeModulesPackageRoot(segments, index),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -416,6 +416,15 @@ describe("collectPackedTestCargoErrors", () => {
|
|||||||
).toEqual([]);
|
).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", () => {
|
it("normalizes Windows or mixed separators before classifying test cargo", () => {
|
||||||
expect(
|
expect(
|
||||||
collectPackedTestCargoErrors([
|
collectPackedTestCargoErrors([
|
||||||
|
|||||||
Reference in New Issue
Block a user