Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fetch-mock/jest

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fetch-mock/jest

jest wrapper for fetch-mock

  • 0.2.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@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

Keywords

FAQs

Package last updated on 04 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc