Skip to content

v0.4.0

Compare
Choose a tag to compare
@IanVS IanVS released this 25 Oct 13:50
· 6 commits to main since this release

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:

New Contributors

Full Changelog: v0.3.0...v0.4.0