From 1f5fc085f140a9a2ded93fd783596e6229c22b90 Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Tue, 17 Apr 2018 14:03:09 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Don't=20call=20process.exit()=20?= =?UTF-8?q?in=20Karma=20during=20normal=20pass=20/=20fail=20flow=20(#14669?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-system/tasks/runtime-test.js | 32 +++++++++--------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/build-system/tasks/runtime-test.js b/build-system/tasks/runtime-test.js index d0641552558f..f6eb4e5165d1 100644 --- a/build-system/tasks/runtime-test.js +++ b/build-system/tasks/runtime-test.js @@ -239,8 +239,6 @@ function runTests() { log(red('ERROR:'), 'Only integration tests may be run on the full set of ' + 'Sauce Labs browsers'); log('Use', cyan('--saucelabs'), 'with', cyan('--integration')); - // Flush stdout. - process.stdout.write('\n'); process.exit(); } @@ -337,22 +335,14 @@ function runTests() { } // Run fake-server to test XHR responses. - const server = gulp.src(process.cwd()) - .pipe(webserver({ - port: 31862, - host: 'localhost', - directoryListing: true, - middleware: [app], - }) - .on('kill', function() { - log(yellow( - 'Shutting down test responses server on localhost:31862')); - process.nextTick(function() { - // Flush stdout. - process.stdout.write('\n'); - process.exit(); - }); - })); + const server = gulp.src(process.cwd()).pipe(webserver({ + port: 31862, + host: 'localhost', + directoryListing: true, + middleware: [app], + }).on('kill', function() { + log(yellow('Shutting down test responses server on localhost:31862')); + })); log(yellow( 'Started test responses server on localhost:31862')); @@ -380,12 +370,8 @@ function runTests() { log( red('ERROR:'), yellow('Karma test failed with exit code ' + exitCode)); - // Flush stdout. - process.stdout.write('\n'); - process.exit(exitCode); - } else { - resolver(); } + resolver(); }).on('run_start', function() { if (argv.saucelabs || argv.saucelabs_lite) { console./* OK*/log(green(