test: tighten update startup absence assertion

This commit is contained in:
Peter Steinberger
2026-05-09 02:46:28 +01:00
parent 0aa7633f5c
commit 55439d81a1

View File

@@ -151,6 +151,10 @@ describe("update-startup", () => {
return { log, parsed };
}
async function expectPathMissing(targetPath: string): Promise<void> {
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 () => {