diff --git a/lib/unhandled-rejection.spec.js b/lib/unhandled-rejection.spec.js new file mode 100644 index 0000000000000000000000000000000000000000..ec8b621c8934ee59b540c8c073f1ac2b9f609eaf --- /dev/null +++ b/lib/unhandled-rejection.spec.js @@ -0,0 +1,5 @@ +'use strict'; + +// Cause unhandled promise rejections to fail unit tests, and print with stack +// traces. +process.on('unhandledRejection', error => { throw error; }); diff --git a/service-tests/runner/cli.js b/service-tests/runner/cli.js index f5f24da1ac7a3178894c4549677fc3a26a0a812c..fbb5db80553d41b7adb3759f99e51fc8c3e7a0e7 100644 --- a/service-tests/runner/cli.js +++ b/service-tests/runner/cli.js @@ -50,6 +50,8 @@ const readAllStdinSync = require('read-all-stdin-sync'); const Runner = require('./runner'); const serverHelpers = require('../../lib/in-process-server-test-helpers'); +require('../../lib/unhandled-rejection.spec'); + let server; before('Start running the server', function () { this.timeout(5000);