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.1.8 to 1.1.9

2

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

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

@@ -22,2 +22,19 @@ # What's this?

# API
The API of this synchronous promise matches the one of the regular Promise, with two additional instance methods (attached to an instance of the Promise):
* `resolve` - resolves a promise instance
* `reject` - rejects a promise instance
This methods do the same job as the ones passed to the main callback function:
```javascript
new Promise((resolve, reject) => { resolve(1,2); });
```
Having them attached to the instance enables us to call them outside the callback function, which makes our code much more readable:
```javascript
let promise = new Promise();
promise.resolve(1,2);
```
# How does it work - Examples

@@ -191,20 +208,3 @@

# API
The API of this synchronous promise matches the one of the regular Promise, with two additional instance methods (attached to an instance of the Promise):
* `resolve` - resolves a promise instance
* `reject` - rejects a promise instance
This methods do the same job as the ones passed to the main callback function:
```javascript
new Promise((resolve, reject) => { resolve(1,2); });
```
Having them attached to the instance enables us to call them outside the callback function, which makes our code much more readable:
```javascript
let promise = new Promise();
promise.resolve(1,2);
```
# License
MIT License, http://www.opensource.org/licenses/MIT
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