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

faked-promise

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

faked-promise

Create a fake promise that can be resolve and rejected programatically

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
94
Maintainers
1
Weekly downloads
 
Created
Source

faked-promise Build Status npm package coverage donate

Create a fake promise that can be resolve and rejected programatically

Installation

npm i faked-promise

Usage

faked-promise exports one single function that returns a promise. This promise resolves into an array with 3 elements:

  • A real promise
  • Its resolve callback
  • Its reject callback

Meaning you can control exactly when the promise is resolved or rejected:

const fakePromise = require('faked-promise')

const [promise, resolve, reject] = await fakePromise()
promise.then(() => {})
resolve('any value')

License

MIT

FAQs

Package last updated on 28 Jan 2018

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