Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e1394ee

Browse filesBrowse files
edsadraddaleax
authored andcommitted
test: refactor test-tls-friendly-error-message.js
Replaces var with const and adds common.mustCall(). PR-URL: #9967 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 3253954 commit e1394ee
Copy full SHA for e1394ee

File tree

Expand file treeCollapse file tree

1 file changed

+11
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-11
lines changed
Open diff view settings
Collapse file
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
3+
const assert = require('assert');
44

55
if (!common.hasCrypto) {
66
common.skip('missing crypto');
77
return;
88
}
9-
var tls = require('tls');
9+
const tls = require('tls');
1010

11-
var fs = require('fs');
11+
const fs = require('fs');
1212

13-
var key = fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem');
14-
var cert = fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem');
13+
const key = fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem');
14+
const cert = fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem');
1515

16-
tls.createServer({ key: key, cert: cert }, function(conn) {
16+
tls.createServer({ key: key, cert: cert }, common.mustCall(function(conn) {
1717
conn.end();
1818
this.close();
19-
}).listen(0, function() {
19+
})).listen(0, common.mustCall(function() {
2020
var options = { port: this.address().port, rejectUnauthorized: true };
2121
tls.connect(options).on('error', common.mustCall(function(err) {
22-
assert.equal(err.code, 'UNABLE_TO_VERIFY_LEAF_SIGNATURE');
23-
assert.equal(err.message, 'unable to verify the first certificate');
22+
assert.strictEqual(err.code, 'UNABLE_TO_VERIFY_LEAF_SIGNATURE');
23+
assert.strictEqual(err.message, 'unable to verify the first certificate');
2424
this.destroy();
2525
}));
26-
});
26+
}));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.