🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

jest-mocks

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
68

Supply Chain Security

100

Vulnerability

74

Quality

76

Maintenance

100

License

Unpopular package

Quality

This package is not very popular.

Found 1 instance in 1 package

Dependencies have 4 high alerts.

Socket optimized override available

Version published
Weekly downloads
412
-34.19%
Maintainers
1
Weekly downloads
 
Created

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.

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