mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 18:26:52 +00:00

* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
36 lines
663 B
JavaScript
36 lines
663 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const https = require('https');
|
|
|
|
const agent = new https.Agent();
|
|
|
|
// empty options
|
|
assert.strictEqual(
|
|
agent.getName({}),
|
|
'localhost::::::::::'
|
|
);
|
|
|
|
// pass all options arguments
|
|
const options = {
|
|
host: '0.0.0.0',
|
|
port: 443,
|
|
localAddress: '192.168.1.1',
|
|
ca: 'ca',
|
|
cert: 'cert',
|
|
ciphers: 'ciphers',
|
|
key: 'key',
|
|
pfx: 'pfx',
|
|
rejectUnauthorized: false,
|
|
servername: 'localhost',
|
|
};
|
|
|
|
assert.strictEqual(
|
|
agent.getName(options),
|
|
'0.0.0.0:443:192.168.1.1:ca:cert:ciphers:key:pfx:false:localhost:'
|
|
);
|