Socket
Socket
Sign inDemoInstall

slow-promise

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    slow-promise

Slow down your promises


Version published
Maintainers
1
Install size
56.4 kB
Created

Readme

Source

slow-promise

Slow-Promise gives you ES6 promises in roughly 20 LOC and 900 bytes (not even minified).

Its downsides are

  • it's slow,
  • it relies on another Promise implementation being present doing the hard work.

Example

Slow-Promise surfacing a flaky test in Puppeteer: ./examples/puppeteer/

Why?

The author wants to make browser testing a better experience, most prominently more stable. They believe that one reason tests via a browser tend to be fragile and flaky is because humans are generally bad at modelling asynchrony.

A hypothetical

Assume on a good day you write a new passing test, only to see it fail rather randomly the following day. It just happened to be that your app felt somewhat slow and unresponsive. Chances are you just sit through it and wait for everything to go faster again. Naturally your tests will be back to green.

What if this happens again and again? Your team will get used to brittle test, and start re-running failing tests. Eventually this will become the norm.

What if you could stop this process early on, and just surface those poorly written tests? Those which depend on your application being at its best! Imagine you could slow down your app on every given day and force those out.

Slow-Promise isn't good much, but it is good at that!

Howto

$ npm test
$ npm run dist
$ open test_integration.html

Keywords

FAQs

Last updated on 23 Apr 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc