vi.mock doesn't intercept ESM in Workers vitest pool
A testing trick that silently doesn't work for Cloudflare Workers.
how it works
With @cloudflare/vitest-pool-workers, spy on class prototypes instead of vi.mock for ESM imports.
Technique: A pattern or hard-won lesson, written down so it isn't learned twice.
The code for this one lives in a private repo. This page explains the idea so you can build your own.