Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: change var to const and add mustCall in crypto tests #9954

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions test/parallel/test-tls-client-getephemeralkeyinfo.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
'use strict';
var common = require('../common');
var assert = require('assert');
const common = require('../common');
const assert = require('assert');

if (!common.hasCrypto) {
common.skip('missing crypto');
process.exit();
}
var tls = require('tls');
const tls = require('tls');

var fs = require('fs');
var key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem');
var cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem');
const fs = require('fs');
const key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem');
const cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem');

var ntests = 0;
var nsuccess = 0;
Expand Down Expand Up @@ -45,12 +45,12 @@ function test(size, type, name, next) {
conn.end();
});

server.on('close', function(err) {
server.on('close', common.mustCall(function(err) {
assert(!err);
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({
port: this.address().port,
rejectUnauthorized: false
Expand All @@ -62,7 +62,7 @@ function test(size, type, name, next) {
nsuccess++;
server.close();
});
});
}));
}

function testNOT_PFS() {
Expand Down