Skip to content

Instantly share code, notes, and snippets.

@Kmaschta
Created October 27, 2017 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kmaschta/ebc88d7cc48120593bfada12d7e67feb to your computer and use it in GitHub Desktop.
Save Kmaschta/ebc88d7cc48120593bfada12d7e67feb to your computer and use it in GitHub Desktop.
Prevent unhandled Promise rejection errors
// Warn from unhandled promise rejection that can occurs without failing tests
// jest --setupFiles setup-tests.js
process.on('unhandledRejection', (error, promise) => {
console.error('Unhandled Rejection at:', promise, `\n${error.stack}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment