Skip to content

Commit 4a781ba

Browse files
author
Joshua Grosso
committed
Kill LFS test server on unhandled Promise rejection in specs
1 parent 387cf6f commit 4a781ba

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/runner.js

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ import * as testLFSServer from './server/server';
2323
// http://eng.wealthfront.com/2016/11/03/handling-unhandledrejections-in-node-and-the-browser/
2424
process.on('unhandledRejection', (err) => {
2525
console.error('CAUGHT ERROR:', err); // eslint-disable-line no-console
26+
27+
try {
28+
testLFSServer.stop();
29+
} catch (e) {
30+
// The server may not have been started yet
31+
}
32+
2633
process.exit(1);
2734
});
2835

0 commit comments

Comments
 (0)