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

flush-promises

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flush-promises

Flush promises in tests

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
285K
decreased by-0.75%
Maintainers
1
Weekly downloads
 
Created

What is flush-promises?

The 'flush-promises' npm package is a utility designed to help with testing asynchronous code in JavaScript. It allows you to flush all pending resolved promises, making it easier to test code that relies on asynchronous operations.

What are flush-promises's main functionalities?

Flushing Promises

This feature allows you to flush all pending promises, ensuring that all asynchronous operations have completed. This is particularly useful in testing scenarios where you need to wait for all promises to resolve before making assertions.

const flushPromises = require('flush-promises');

async function asyncFunction() {
  return 'resolved';
}

asyncFunction().then(result => console.log(result));

flushPromises().then(() => {
  console.log('All promises have been flushed');
});

Other packages similar to flush-promises

Keywords

FAQs

Package last updated on 01 Nov 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