Skip to content

Commit

Permalink
🐛 Don't call process.exit() in Karma during normal pass / fail flow (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha authored and glevitzky committed Apr 27, 2018
1 parent c6be0c9 commit 4af1b67
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions build-system/tasks/runtime-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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'));

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 4af1b67

Please sign in to comment.