mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 04:20:42 +00:00
test: tighten image tempdir cleanup assertion
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user