test: refactor test-tls-client-getephemeralkeyinfo
change var to const and add mustCall PR-URL: https://github.com/nodejs/node/pull/9954 Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
7e7062cdca
commit
0ff69b46da
@ -1,16 +1,16 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
const common = require('../common');
|
||||||
var assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
if (!common.hasCrypto) {
|
if (!common.hasCrypto) {
|
||||||
common.skip('missing crypto');
|
common.skip('missing crypto');
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
}
|
||||||
var tls = require('tls');
|
const tls = require('tls');
|
||||||
|
|
||||||
var fs = require('fs');
|
const fs = require('fs');
|
||||||
var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem');
|
const key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem');
|
||||||
var cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem');
|
const cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem');
|
||||||
|
|
||||||
var ntests = 0;
|
var ntests = 0;
|
||||||
var nsuccess = 0;
|
var nsuccess = 0;
|
||||||
@ -45,12 +45,12 @@ function test(size, type, name, next) {
|
|||||||
conn.end();
|
conn.end();
|
||||||
});
|
});
|
||||||
|
|
||||||
server.on('close', function(err) {
|
server.on('close', common.mustCall(function(err) {
|
||||||
assert(!err);
|
assert(!err);
|
||||||
if (next) next();
|
if (next) next();
|
||||||
});
|
}));
|
||||||
|
|
||||||
server.listen(0, '127.0.0.1', function() {
|
server.listen(0, '127.0.0.1', common.mustCall(function() {
|
||||||
var client = tls.connect({
|
var client = tls.connect({
|
||||||
port: this.address().port,
|
port: this.address().port,
|
||||||
rejectUnauthorized: false
|
rejectUnauthorized: false
|
||||||
@ -62,7 +62,7 @@ function test(size, type, name, next) {
|
|||||||
nsuccess++;
|
nsuccess++;
|
||||||
server.close();
|
server.close();
|
||||||
});
|
});
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function testNOT_PFS() {
|
function testNOT_PFS() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user