Skip to content

Commit ab45d20

Browse files
authored
node: fix test-http2-client-promisify-connect-error.js (#22355)
1 parent 21841af commit ab45d20

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
7+
const assert = require('assert');
8+
const http2 = require('http2');
9+
const util = require('util');
10+
11+
const connect = util.promisify(http2.connect);
12+
13+
const error = new Error('Unable to resolve hostname');
14+
15+
function lookup(hostname, options, callback) {
16+
callback(error);
17+
}
18+
19+
assert.rejects(
20+
connect('http://hostname', { lookup }),
21+
error,
22+
).then(common.mustCall());

0 commit comments

Comments
 (0)