mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-22 03:51:18 +00:00
test: tighten image tempdir cleanup assertion
This commit is contained in:
parent
c605a0e6e8
commit
3cf5b8f7f5
1 changed files with 8 additions and 1 deletions
|
|
@ -31,6 +31,13 @@ describe("image-ops temp dir", () => {
|
|||
expect(prefix).toEqual(expect.stringMatching(/^.+openclaw-img-[0-9a-f-]+-$/u));
|
||||
expect(path.dirname(prefix ?? "")).toBe(secureRoot);
|
||||
expect(createdTempDir.startsWith(prefix ?? "")).toBe(true);
|
||||
await expect(fs.access(createdTempDir)).rejects.toMatchObject({ code: "ENOENT" });
|
||||
let accessError: unknown;
|
||||
try {
|
||||
await fs.access(createdTempDir);
|
||||
} catch (error) {
|
||||
accessError = error;
|
||||
}
|
||||
expect(accessError).toBeInstanceOf(Error);
|
||||
expect((accessError as NodeJS.ErrnoException).code).toBe("ENOENT");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue