diff --git a/src/infra/archive-helpers.test.ts b/src/infra/archive-helpers.test.ts index 95351df001b..85945f709a1 100644 --- a/src/infra/archive-helpers.test.ts +++ b/src/infra/archive-helpers.test.ts @@ -8,7 +8,7 @@ import { resolvePackedRootDir, } from "./archive.js"; import { pathExists, withTimeout } from "./fs-safe.js"; -import { readJsonFileStrict } from "./json-files.js"; +import { JsonFileReadError, readJsonFileStrict } from "./json-files.js"; const tempDirs = createTrackedTempDirs(); const createTempDir = () => tempDirs.make("openclaw-archive-helper-test-"); @@ -159,7 +159,7 @@ describe("archive helpers", () => { await fs.writeFile(badPath, "{not json", "utf8"); await expect(readJsonFileStrict<{ ok: boolean }>(jsonPath)).resolves.toEqual({ ok: true }); - await expect(readJsonFileStrict(badPath)).rejects.toThrow(); + await expect(readJsonFileStrict(badPath)).rejects.toBeInstanceOf(JsonFileReadError); await expect(pathExists(jsonPath)).resolves.toBe(true); await expect(pathExists(path.join(dir, "missing.json"))).resolves.toBe(false); });