Releases: IanVS/vitest-fetch-mock
v0.4.3
v0.4.2
v0.4.1
What's Changed
- fix: make fetchMock globally available again by @dirkluijk in #29
- feat: allow more types of overloads by @dirkluijk in #26
- feat: allow passing null or undefined as response body by @dirkluijk in #27
Full Changelog: v0.4.0...v0.4.1
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
v0.3.0
Breaking changes
- Support Vitest 2
- Require Node 18 and above
Fixes
- Better TypeScript support
PRs:
- Update to vitest 2 by @birtles in #18
- Update dependencies by @IanVS in #20
- Update node versions tested in CI by @IanVS in #19
- Fix: move index.d.ts alongside index.js main entry by @drwpow in #11
New Contributors
Full Changelog: v0.2.2...v0.3.0
v0.2.2
What's Changed
Features
- Expose .calls with normalizeRequest by @stefnotch in #8
Docs
- fetchMock -> fetchMocker by @Maxim-Mazurok in #5
- Use JSDoc Comment style by @stefnotch in #7
- Update README with minor copy changes by @ummahusla in #9
New Contributors
- @Maxim-Mazurok made their first contribution in #5
- @stefnotch made their first contribution in #7
- @ummahusla made their first contribution in #9
Full Changelog: v0.2.1...v0.2.2
v0.2.1
Support versions of vitest > 0.16
Full Changelog: v0.2.0...v0.2.1
v0.2.0 - Vitest 0.16+
What's Changed
- Support vitest 0.16+ by @jasikpark in #3
New Contributors
- @jasikpark made their first contribution in #3
Full Changelog: v0.1.0...v0.2.0
v0.1.0
What's Changed
Initial fork from https://github.com/jefflau/jest-fetch-mock, adjusted to function with vitest (without global vi
).