v0.4.0
Breaking changes
This release includes a complete rewrite into TypeScript by @dirkluijk, the removal of the cross-fetch polyfill dependency, and a minor change to the API when using a function that returned a mock response.
Before:
fetch.mockResponseOnce(() => Promise.resolve({ body: 'ok', init: { headers: { 'x-foo': 'bar' } } }));
After:
fetch.mockResponseOnce(() => Promise.resolve({ body: 'ok', headers: { 'x-foo': 'bar' } }));
Note there is no longer an init
property. Now, headers
, status
, etc are included alongside the body
. This applies to all methods which can accept a ResponseProvider
parameter. (Previously the parameter was called MockResponseInitFunction
and headers could be specified inside or outside of init
, and it was unclear which would take precedence.)
PRs:
- feat: decouple from cross-fetch by @dirkluijk in #24
New Contributors
- @dirkluijk made their first contribution in #24
Full Changelog: v0.3.0...v0.4.0