New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jest-mocks

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-mocks

A set of useful mocks and helpers for the Jest unit testing framework.

  • 1.0.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
329
decreased by-27.69%
Maintainers
1
Weekly downloads
 
Created
Source

Jest Mocks

A set of useful mocks and helpers for the Jest unit testing framework.

Available helpers

All provided helpers have full TypeScript support with inferred types based on the arguments they're called with.

filterMockCalls(mock, ...args)

Returns an array of calls from the provided Jest Mock, where args matches the args the mock was called with.

findMockCall(mock, ...args)

Returns the first matching call from the provided Jest Mock, where args matches the args the mock was called with.

resolvedPromise(value)

Returns a Promise that will instantly resolve with the provided value.

rejectedPromise(error)

Returns a Promise that will instantly be rejected with the provided error.

mockWithResolvedPromise(value)

Returns an async Jest Mock that will instantly resolve with the provided value when called.

mockWithRejectedPromise(error)

Returns an async Jest Mock that will instantly be rejected with the provided error when called.

Keywords

FAQs

Package last updated on 12 May 2021

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