Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
replace catch with unhandledRejection-listener
  • Loading branch information
Karl Böhlmark committed Nov 3, 2016
commit 5c37b4a2ea6782a572f3612901f6f89394aef7dd
10 changes: 5 additions & 5 deletions test/parallel/test-http-client-timeout-option-listeners.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
require('../common');
const common = require('../common');
const http = require('http');
const assert = require('assert');

Expand All @@ -18,6 +18,10 @@ const options = {
timeout: 10
};

process.on('unhandledRejection', function() {
common.fail('A promise rejection was unhandled');
});

server.listen(0, options.host, (e) => {
options.port = server.address().port;

Expand All @@ -27,10 +31,6 @@ server.listen(0, options.host, (e) => {
'Should be a single timeout listener on the socket');
server.close();
agent.destroy();
})
.catch((e) => {
console.log(e);
process.exit(1);
});
});

Expand Down