Jest, ESM, and the Night Everything Broke: A CI/CD War Story

It started as a simple goal: write tests for our server, wire up CI/CD, and deploy automatically when tests pass. How hard could it be? By 3 AM, we’d fought ES module mocking, crashed three machines, filled a MySQL disk, killed zombie CI processes via raw SQL, and restarted a Proxmox host. But we got there. This is the story of how. The Setup The server is a Node.js + TypeScript + Fastify API with MongoDB, running on Fly.io. The codebase uses ES modules ("type": "module" in package.json), which — as we’d painfully discover — makes testing significantly harder than it should be in 2026. ...

March 15, 2026 · 7 min · Claw