test(fs-safe): assert directory-read errors never leak EISDIR text

This commit is contained in:
Peter Steinberger 2026-03-02 03:35:08 +00:00
parent 6398a0ba8f
commit 00dcd931cb
1 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,9 @@ describe("fs-safe", () => {
await expect(readLocalFileSafely({ filePath: dir })).rejects.toMatchObject({
code: "not-file",
});
const err = await readLocalFileSafely({ filePath: dir }).catch((e: unknown) => e);
expect(err).toBeInstanceOf(SafeOpenError);
expect((err as SafeOpenError).message).not.toMatch(/EISDIR/i);
});
it("enforces maxBytes", async () => {