mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-07 22:44:16 +00:00
test(fs-safe): assert directory-read errors never leak EISDIR text
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user