diff --git a/src/infra/update-startup.test.ts b/src/infra/update-startup.test.ts index 793a1d87b1b..cf53f19377b 100644 --- a/src/infra/update-startup.test.ts +++ b/src/infra/update-startup.test.ts @@ -151,6 +151,10 @@ describe("update-startup", () => { return { log, parsed }; } + async function expectPathMissing(targetPath: string): Promise { + await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); + } + function createAutoUpdateSuccessMock() { return vi.fn().mockResolvedValue({ ok: true, @@ -295,7 +299,7 @@ describe("update-startup", () => { }); expect(log.info).not.toHaveBeenCalled(); - await expect(fs.stat(path.join(tempDir, "update-check.json"))).rejects.toThrow(); + await expectPathMissing(path.join(tempDir, "update-check.json")); }); it("defers stable auto-update until rollout window is due", async () => {