Skip to content

Commit

Permalink
test: added tests for https-agent-getname
Browse files Browse the repository at this point in the history
PR-URL: #6762
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
  • Loading branch information
suryagh authored and rvagg committed Jun 2, 2016
1 parent 6441556 commit 7c932c2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/parallel/test-https-agent-getname.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

require('../common');
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'
);

0 comments on commit 7c932c2

Please sign in to comment.