Skip to content

Commit e490f3f

Browse files
PierrunoYTclaude
andcommitted
test(checkpoints): assert the failed untracked-file removal was attempted
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent c3be8f3 commit e490f3f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎src/services/checkpoints/__tests__/ShadowCheckpointService.spec.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ describe.each([[RepoPerTaskCheckpointService, "RepoPerTaskCheckpointService"]])(
364364
.spyOn(fs, "rm")
365365
.mockRejectedValue(Object.assign(new Error("busy"), { code: "EBUSY" }))
366366
await service.restoreCheckpoint(checkpoint!.commit)
367+
// The removal was attempted (and failed), so the tracked reset below is not just the happy path.
368+
expect(rm).toHaveBeenCalledWith(untracked, { force: true, recursive: false })
367369
rm.mockRestore()
368370
expect(await fs.readFile(testFile, "utf8")).toBe("Hello, world!")
369371
})

0 commit comments

Comments
 (0)