diff --git a/scripts/openclaw-npm-release-check.ts b/scripts/openclaw-npm-release-check.ts index 850b04a25f3..a0a5f744e1a 100644 --- a/scripts/openclaw-npm-release-check.ts +++ b/scripts/openclaw-npm-release-check.ts @@ -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), ); diff --git a/test/openclaw-npm-release-check.test.ts b/test/openclaw-npm-release-check.test.ts index 75c5a8748f5..e80099f9458 100644 --- a/test/openclaw-npm-release-check.test.ts +++ b/test/openclaw-npm-release-check.test.ts @@ -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([