Skip to content

Commit

Permalink
Kill LFS test server on unhandled Promise rejection in specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Grosso committed Aug 31, 2017
1 parent 387cf6f commit 4a781ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ import * as testLFSServer from './server/server';
// http://eng.wealthfront.com/2016/11/03/handling-unhandledrejections-in-node-and-the-browser/
process.on('unhandledRejection', (err) => {
console.error('CAUGHT ERROR:', err); // eslint-disable-line no-console

try {
testLFSServer.stop();
} catch (e) {
// The server may not have been started yet
}

process.exit(1);
});

Expand Down

0 comments on commit 4a781ba

Please sign in to comment.