0.2.3 • Published 10 months ago

@fetch-mock/vitest v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@fetch-mock/vitest

A wrapper for fetch-mock that improves the developer experience when working with vitest. It provides the following:

  • Adds methods to fetchMock which wrap its default methods, but align more closely with vitest's naming conventions.
  • Extends expect with convenience methods allowing for expressive tests such as expect(fetchMock).toHavePosted('http://example.com', {id: 'test-id'}).
  • Can optionally be hooked in to vitest's global mock management methods such as clearAllMocks().

Requirements

@fetch-mock/vitest requires either of the following to run:

  • vitest
  • The fetch API, via one of the following:
    • Node.js 18+ for full feature operation
    • Any modern browser that supports the fetch API
    • node-fetch when testing in earlier versions of Node.js (this is untested, but should mostly work)

Documentation and Usage

See the project website

License

@fetch-mock/vitest is licensed under the MIT license. Copyright © 2024, Rhys Evans

0.2.1

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.0

10 months ago

0.1.5

11 months ago

0.1.4

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago