mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
test: improve error output of test-http2-client-promisify-connect-error
PR-URL: https://github.com/nodejs/node/pull/57135 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
d1845edd21
commit
89f3feb364
1 file changed
+5
-8
@@ -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());
|
||||
}));
|
||||
}));
|
||||
Reference in new issue
Block a user