Skip to content

Commit 86b398a

Browse files
cliffhallclaude
andcommitted
test(filesystem): default lstat to missing in validatePath unit tests
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
1 parent a2fd82c commit 86b398a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/filesystem/__tests__/lib.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ describe("Lib Functions", () => {
298298
mockFs.realpath.mockImplementation(async (path: PathLike) =>
299299
path.toString(),
300300
);
301+
// A name the path resolver lstats is missing unless a test says
302+
// otherwise, so an unmatched component starts the missing tail.
303+
const enoent = new Error("ENOENT") as NodeJS.ErrnoException;
304+
enoent.code = "ENOENT";
305+
mockFs.lstat.mockRejectedValue(enoent);
301306
});
302307

303308
it("validates allowed paths", async () => {

0 commit comments

Comments
 (0)