James Washington
writing about archive utils free game ideas replays
Technique

vi.mock doesn't intercept ESM in Workers vitest pool

A testing trick that silently doesn't work for Cloudflare Workers.

Cloudflare and the edge

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.

cloudflaretechniquetestingvitest

related

  • LiteLLM-as-container job engine behind a DO binding API The backend that runs paid AI document jobs for a small SaaS.
← everything I've built
© 2026 James Washington
github twitter rss