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

jest-mock-promise

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-mock-promise - npm Package Compare versions

Comparing version 1.0.19 to 1.0.20

2

package.json
{
"name": "jest-mock-promise",
"version": "1.0.19",
"version": "1.0.20",
"description": "Synchronous Promise Mock for testing with Jest",

@@ -5,0 +5,0 @@ "main": "dist/jest-mock-promise.js",

@@ -103,2 +103,4 @@ # What's this?

// providing two numbers which need to be multiplied
// as we know, although we have resolved the promise right away,
// `then` handlers will be called asnyc at later time
resolve(1,2);

@@ -110,5 +112,6 @@ });

// since the promise will be resolved async,
// we need to test our expectation inside a `then` handler
// and also return a promise to the Jest, so it knows
// Altought promise is already resolved, `then` handlers will
// be called asnyc at later time. That's why we need to put
// our expectation inside a `then` handler
// + we need to return a promise to the Jest, so it knows
// we're doing some async testing

@@ -115,0 +118,0 @@ return(promise.then(() => {

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