mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 02:07:26 +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({
|
await expect(readLocalFileSafely({ filePath: dir })).rejects.toMatchObject({
|
||||||
code: "not-file",
|
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 () => {
|
it("enforces maxBytes", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user