diff --git a/services/web/docker-compose.ci.yml b/services/web/docker-compose.ci.yml index 91cf8c933a..13a10b7fbc 100644 --- a/services/web/docker-compose.ci.yml +++ b/services/web/docker-compose.ci.yml @@ -10,6 +10,8 @@ services: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER user: node command: npm run test:unit:app + environment: + NODE_OPTIONS: "--unhandled-rejections=strict" test_acceptance: build: . @@ -25,6 +27,7 @@ services: LINKED_URL_PROXY: 'http://localhost:6543' LOCK_MANAGER_MAX_LOCK_WAIT_TIME: 30000 NODE_ENV: test + NODE_OPTIONS: "--unhandled-rejections=strict" SHARELATEX_CONFIG: command: npm run test:acceptance:app user: root @@ -43,12 +46,16 @@ services: working_dir: /app command: npm run test:karma:single user: node + environment: + NODE_OPTIONS: "--unhandled-rejections=strict" test_frontend: build: . image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER user: node command: npm run test:frontend + environment: + NODE_OPTIONS: "--unhandled-rejections=strict" tar: image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER-webpack diff --git a/services/web/docker-compose.yml b/services/web/docker-compose.yml index 4bbfd59aad..1d0df6eecb 100644 --- a/services/web/docker-compose.yml +++ b/services/web/docker-compose.yml @@ -14,6 +14,7 @@ services: working_dir: /app environment: MOCHA_GREP: ${MOCHA_GREP} + NODE_OPTIONS: "--unhandled-rejections=strict" command: npm run --silent test:unit:app user: node @@ -32,6 +33,7 @@ services: ENABLED_LINKED_FILE_TYPES: 'url,project_file,project_output_file,mendeley,zotero' MOCHA_GREP: ${MOCHA_GREP} NODE_ENV: test + NODE_OPTIONS: "--unhandled-rejections=strict" LOCK_MANAGER_MAX_LOCK_WAIT_TIME: 30000 MONGO_SOCKET_TIMEOUT: 60000 # SHARELATEX_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING: 'true' @@ -47,6 +49,8 @@ services: dockerfile: Dockerfile.frontend volumes: - .:/app + environment: + NODE_OPTIONS: "--unhandled-rejections=strict" working_dir: /app command: npm run --silent test:karma:single @@ -59,6 +63,7 @@ services: working_dir: /app environment: MOCHA_GREP: ${MOCHA_GREP} + NODE_OPTIONS: "--unhandled-rejections=strict" command: npm run --silent test:frontend user: node diff --git a/services/web/test/acceptance/bootstrap.js b/services/web/test/acceptance/bootstrap.js index badb8ecf83..76909ef833 100644 --- a/services/web/test/acceptance/bootstrap.js +++ b/services/web/test/acceptance/bootstrap.js @@ -4,9 +4,3 @@ chai.use(require('chaid')) // Do not truncate assertion errors chai.config.truncateThreshold = 0 - -// Crash the process on an unhandled promise rejection -process.on('unhandledRejection', err => { - console.error('Unhandled promise rejection:', err) - process.exit(1) -}) diff --git a/services/web/test/unit/bootstrap.js b/services/web/test/unit/bootstrap.js index 69a9eb0d33..cdf64d416a 100644 --- a/services/web/test/unit/bootstrap.js +++ b/services/web/test/unit/bootstrap.js @@ -17,12 +17,6 @@ chai.config.truncateThreshold = 0 // add support for mongoose in sinon require('sinon-mongoose') -// Crash the process on an unhandled promise rejection -process.on('unhandledRejection', err => { - console.error('Unhandled promise rejection:', err) - process.exit(1) -}) - afterEach(function() { sinon.restore() })