module@warp-drive/holodeck
🛑 CANARY ONLY 🛑
@warp-drive/holodeck is still experimental
⚡️ Simple, Fast HTTP Mocking
Ideal for Test Suites
- ⚡️ Real network requests
- brotli compression
- http/2
- no CORS preflight requests
- 💜 Unparalleled DX
- debug real network requests
- every request is scoped to a test
- run as many tests as desired simultaneously
- 🔥 Blazing Fast Tests
- record your tests when you change them
- replays from cache until you change them again
- the cache is managed by git, so switching branches works seamlessly, and CI and rebases skip work that is already recorded
- zero-work: setup work is skipped when in replay mode
Installation
sh
pnpm add -E @warp-drive/holodeck@canaryGuides
- Testing Overview: why a real server, and how record and replay works.
- Server Setup: certificates, and launching with Diagnostic or Testem.
- Client Setup: adding
MockServerHandlerto the request chain. - Test Framework Integration: test ids and the mock host.
- Common Setups: one origin for the page and the mock server, from Vite, testem or Caddy.
- Writing Mocks: the mock helpers and the matching rules.
- Recording and Replaying: modes, fixtures and CI.
- Troubleshooting: indexed by the errors holodeck prints.
- HoloPrograms: a proposed, not yet implemented, way to set up a test's whole API state in one call.
- Holodeck in Dev Mode: run holodeck next to your dev server so the test page in the browser works too.