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 66554c7

Browse filesBrowse files
stpCollabr8nLstnaddaleax
authored andcommitted
test: refactor test-tls-ecdh
clear out const/let change assert.notEqual to assert move assert after common.hasCrypto check PR-URL: #9878 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent a857c9a commit 66554c7
Copy full SHA for 66554c7

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+10
-10
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-tls-ecdh.js‎

Copy file name to clipboard
+10-10Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
2+
const common = require('../common');
43

54
if (!common.hasCrypto) {
65
common.skip('missing crypto');
76
return;
87
}
9-
var tls = require('tls');
8+
const assert = require('assert');
9+
const tls = require('tls');
1010

11-
var exec = require('child_process').exec;
12-
var fs = require('fs');
11+
const exec = require('child_process').exec;
12+
const fs = require('fs');
1313

14-
var options = {
14+
const options = {
1515
key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'),
1616
cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'),
1717
ciphers: '-ALL:ECDHE-RSA-AES128-SHA256',
1818
ecdhCurve: 'prime256v1'
1919
};
2020

21-
var reply = 'I AM THE WALRUS'; // something recognizable
21+
const reply = 'I AM THE WALRUS'; // something recognizable
2222

23-
var server = tls.createServer(options, common.mustCall(function(conn) {
23+
const server = tls.createServer(options, common.mustCall(function(conn) {
2424
conn.end(reply);
2525
}));
2626

2727
server.listen(0, '127.0.0.1', common.mustCall(function() {
28-
var cmd = '"' + common.opensslCli + '" s_client -cipher ' + options.ciphers +
28+
let cmd = '"' + common.opensslCli + '" s_client -cipher ' + options.ciphers +
2929
` -connect 127.0.0.1:${this.address().port}`;
3030

3131
// for the performance and stability issue in s_client on Windows
@@ -34,7 +34,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() {
3434

3535
exec(cmd, common.mustCall(function(err, stdout, stderr) {
3636
if (err) throw err;
37-
assert.notEqual(stdout.indexOf(reply), -1);
37+
assert(stdout.includes(reply));
3838
server.close();
3939
}));
4040
}));

0 commit comments

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