Skip to content

Commit

Permalink
test: improve error output of test-http2-client-promisify-connect-error
Browse files Browse the repository at this point in the history
PR-URL: #57135
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
aduh95 authored Feb 21, 2025
1 parent 772c609 commit 8fc919d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/parallel/test-http2-client-promisify-connect-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ const server = http2.createServer();

server.listen(0, common.mustCall(() => {
const port = server.address().port;
server.close(() => {
server.close(common.mustCall(() => {
const connect = util.promisify(http2.connect);
connect(`http://localhost:${port}`)
.then(common.mustNotCall('Promise should not be resolved'))
.catch(common.mustCall((err) => {
assert(err instanceof Error);
assert.strictEqual(err.code, 'ECONNREFUSED');
}));
});
assert.rejects(connect(`http://localhost:${port}`), {
code: 'ECONNREFUSED'
}).then(common.mustCall());
}));
}));

0 comments on commit 8fc919d

Please sign in to comment.