How a 34‑Line QueryDeps Injection Makes Core Query Loops Fully Testable
The article shows how replacing module‑level spyOn with a tiny QueryDeps type and a productionDeps factory eliminates implicit coupling, reduces boilerplate, and enables isolated, type‑safe testing of the core query loop in a large Agent project.
