Răsfoiți Sursa

Fail acceptance tests on unhandled promise rejection

Simon Detheridge 6 ani în urmă
părinte
comite
238d96ed44
1 a modificat fișierele cu 6 adăugiri și 0 ștergeri
  1. 6 0
      services/filestore/test/acceptance/js/FilestoreTests.js

+ 6 - 0
services/filestore/test/acceptance/js/FilestoreTests.js

@@ -26,6 +26,12 @@ if (!process.env.AWS_ACCESS_KEY_ID) {
   throw new Error('please provide credentials for the AWS S3 test server')
   throw new Error('please provide credentials for the AWS S3 test server')
 }
 }
 
 
+process.on('unhandledRejection', e => {
+  // eslint-disable no-console
+  console.log('** Unhandled Promise Rejection **\n', e)
+  throw e
+})
+
 // store settings for multiple backends, so that we can test each one.
 // store settings for multiple backends, so that we can test each one.
 // fs will always be available - add others if they are configured
 // fs will always be available - add others if they are configured
 const BackendSettings = require('./TestConfig')
 const BackendSettings = require('./TestConfig')