mocha-unhandled-rejections-example
It is passed, but We want to fail it...
async function fail() {
throw new Error("FAIL!!");
}
it("unhandled rejection", () => {
fail();
});
Fix the above:
process.on("unhandledRejection", reason => {
throw reason;
});
async function fail() {
throw new Error("FAIL!!");
}
it("unhandled rejection, but throw it", () => {
fail();
});
Changelog
See Releases page.
Running tests
Install devDependencies and Run npm test
:
npm test
Contributing
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
License
MIT © azu