The intention of this repo is to establish, when using promises on node.js, in what circumstances continuation-local-storage context is maintained, and in what cases it gets lost.
This repo contains tests which:
- Try various different ways of using promises
- Test whether continuation-local-storage context is maintained or not in all these cases
- Run these tests against various promise implementations
The tests are run against the following Promise implementations:
- Native JS Promise (where available)
- bluebird v2.x
- bluebird v3.x
- bluebird v2.x with cls-bluebird shim
- bluebird v3.x with cls-bluebird shim
- bluebird v3.x with prototype cls-bluebird2 shim
- sequelize Promise (another approach to shimming bluebird v3.x)
Clone this repo then...
npm install
npm test
Travis CI runs the tests on the following version of node:
- 0.10.x (Native JS Promise is skipped)
- 0.12.x
- 4.x
- 5.x
The results can be viewed at travis-ci.org/overlookmotel/cls-bluebird-test/
See changelog.md
If you discover a bug, please raise an issue on Github. https://github.com/overlookmotel/cls-bluebird-test/issues
Pull requests are very welcome. Please:
- ensure all tests pass before submitting PR
- add an entry to changelog
- add tests for new features
- document new functionality/API additions in README