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
- zero-work: setup work is skipped when in replay mode
pnpm install @warp-drive/holodeck
Tagged Releases
import { GET } from '@warp-drive/holodeck/mock';
await GET(context, 'users/1', () => ({
data: {
id: '1',
type: 'user',
attributes: {
name: 'Chris Thoburn',
},
},
// set RECORD to false or remove
// the options hash entirely once the request
// has been recorded
}), { RECORD: true });
Comprehensive DX around data management should extend to testing.
EmberData already understands your data schemas. Building a mocking utility with tight integration into your data usage patterns could bring enormous DX and test suite performance benefits.
Building a real mock server instead of intercepting requests in the browser or via ServiceWorker gives us out-of-the-box DX, better tunability, and greater ability to optimize test suite performance. Speed is the ultimate DX.
We've noticed test suites spending an enormous amount of time creating and tearing down mock state in between tests. To combat this, we want to provide
an approach built over http/3
(http/2
for now) utilizing aggressive caching
and brotli
minification in a way that can be replayed over and over again.
Basically, pay the cost when you write the test. Forever after skip the cost until you need to edit the test again.