Make scripts crash on unhandled rejections (#1819)

* Makes end-to-end testing crash on unhandled rejections

* Comment fix
This commit is contained in:
David
2017-03-14 20:32:48 +01:00
committed by Joe Haddad
parent b3dc81df7d
commit 0ace417c45
5 changed files with 35 additions and 0 deletions

View File

@@ -13,6 +13,13 @@
process.env.NODE_ENV = 'test';
process.env.PUBLIC_URL = '';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Load environment variables from .env file. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set.