/promise-tests

a test of promise chain behavior

Primary LanguageJavaScript

Promise Behavior Testing

A collection of jest tests to explore and demonstrate the behaviors within promise chains.

I wasn't satisfied with the explanations and examples of the more complex promise chain behavior in the various documentation I was finding so I made this project to test my intuitions on behaviors like:

  • .then() blocks after .catch() blocks
  • .final() blocks
  • throw() behavior

Information on promises:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

Further explanations:

https://www.promisejs.org/

The problem of nested promises:

https://2ality.com/2017/08/promise-callback-data-flow.html

Installation

OS X:

  1. install node and NPM
  2. download/clone this repository
  3. install dependencies:
npm install

Usage example

  • To run the test suite:
npm test

Development setup

coming soon...

Release History

coming soon...

Meta

coming soon...

Contributing

coming soon...

Contributors:

Made with contributors-img.