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 @@
// Do this as the first thing so that any code reading it knows the right env.
process.env.NODE_ENV = 'production';
// 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.

View File

@@ -9,6 +9,13 @@
*/
'use strict';
// 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;
});
const fs = require('fs-extra');
const path = require('path');
const spawnSync = require('cross-spawn').sync;

View File

@@ -9,6 +9,13 @@
*/
'use strict';
// 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;
});
const fs = require('fs-extra');
const path = require('path');
const spawn = require('cross-spawn');

View File

@@ -10,6 +10,13 @@
// @remove-on-eject-end
'use strict';
// 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;
});
process.env.NODE_ENV = 'development';
// Load environment variables from .env file. Suppress warnings using silent

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.