Skip to content

Commit 7c932c2

Browse files
suryaghrvagg
authored andcommitted
test: added tests for https-agent-getname
PR-URL: #6762 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Johan Bergström <[email protected]>
1 parent 6441556 commit 7c932c2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
'use strict';
2+
3+
require('../common');
4+
const assert = require('assert');
5+
const https = require('https');
6+
7+
const agent = new https.Agent();
8+
9+
// empty options
10+
assert.strictEqual(
11+
agent.getName({}),
12+
'localhost:::::::::'
13+
);
14+
15+
// pass all options arguments
16+
const options = {
17+
host: '0.0.0.0',
18+
port: 443,
19+
localAddress: '192.168.1.1',
20+
ca: 'ca',
21+
cert: 'cert',
22+
ciphers: 'ciphers',
23+
key: 'key',
24+
pfx: 'pfx',
25+
rejectUnauthorized: false,
26+
servername: 'localhost',
27+
};
28+
29+
assert.strictEqual(
30+
agent.getName(options),
31+
'0.0.0.0:443:192.168.1.1:ca:cert:ciphers:key:pfx:false:localhost'
32+
);

0 commit comments

Comments
 (0)