0.2.15 • Published 8 months ago

@fetch-mock/jest v0.2.15

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

@fetch-mock/jest

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

  • Adds methods to fetchMock which wrap its default methods, but align more closely with jest'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 jest's global mock management methods such as clearAllMocks().

Requirements

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

  • jest
  • 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.15

8 months ago

0.2.14

8 months ago

0.2.13

8 months ago

0.2.12

8 months ago

0.2.11

8 months ago

0.2.10

9 months ago

0.2.7

11 months ago

0.2.6

11 months ago

0.2.9

9 months ago

0.2.5

11 months ago

0.2.4

11 months ago

0.2.1

12 months ago

0.2.3

12 months ago

0.2.2

12 months ago

0.2.0

12 months ago

0.1.1

1 year ago

0.1.0

1 year ago