Skip to content

Releases: IanVS/vitest-fetch-mock

v0.4.3

20 Dec 17:48
Compare
Choose a tag to compare

What's Changed

  • Add name 'AbortError' for DOMException by @naymic in #36

New Contributors

Full Changelog: v0.4.2...v0.4.3

v0.4.2

07 Nov 15:09
Compare
Choose a tag to compare

What's Changed

  • Support relative request URLs by @IanVS in #34

Full Changelog: v0.4.1...v0.4.2

v0.4.1

28 Oct 14:45
Compare
Choose a tag to compare

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

25 Oct 13:50
Compare
Choose a tag to compare

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

v0.3.0

11 Jul 16:23
Compare
Choose a tag to compare

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

22 Feb 16:03
Compare
Choose a tag to compare

What's Changed

Features

Docs

New Contributors

Full Changelog: v0.2.1...v0.2.2

v0.2.1

07 Jul 16:59
Compare
Choose a tag to compare

Support versions of vitest > 0.16

Full Changelog: v0.2.0...v0.2.1

v0.2.0 - Vitest 0.16+

07 Jul 01:46
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.1.0...v0.2.0

v0.1.0

11 Mar 21:15
72397f9
Compare
Choose a tag to compare

What's Changed

Initial fork from https://github.com/jefflau/jest-fetch-mock, adjusted to function with vitest (without global vi).