We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8421021 commit ccf496cCopy full SHA for ccf496c
test/parallel/test-http2-client-promisify-connect-error.js
@@ -12,13 +12,10 @@ const server = http2.createServer();
12
13
server.listen(0, common.mustCall(() => {
14
const port = server.address().port;
15
- server.close(() => {
+ server.close(common.mustCall(() => {
16
const connect = util.promisify(http2.connect);
17
- connect(`http://localhost:${port}`)
18
- .then(common.mustNotCall('Promise should not be resolved'))
19
- .catch(common.mustCall((err) => {
20
- assert(err instanceof Error);
21
- assert.strictEqual(err.code, 'ECONNREFUSED');
22
- }));
23
- });
+ assert.rejects(connect(`http://localhost:${port}`), {
+ code: 'ECONNREFUSED'
+ }).then(common.mustCall());
+ }));
24
}));
0 commit comments