Skip to content

Commit 676a94e

Browse files
TrottMylesBorins
authored andcommitted
test: refactor test-tls-env-extra-ca
* Use `common.mustCall()` to guarantee callback invocations * Order modules according to test writing guide PR-URL: #13886 Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent fd6bbc0 commit 676a94e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/parallel/test-tls-env-extra-ca.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ if (!common.hasCrypto) {
99
}
1010

1111
const assert = require('assert');
12+
const fs = require('fs');
1213
const tls = require('tls');
14+
1315
const fork = require('child_process').fork;
14-
const fs = require('fs');
1516

1617
if (process.env.CHILD) {
1718
const copts = {
1819
port: process.env.PORT,
19-
checkServerIdentity: common.noop,
20+
checkServerIdentity: common.mustCall(),
2021
};
21-
const client = tls.connect(copts, function() {
22+
const client = tls.connect(copts, common.mustCall(function() {
2223
client.end('hi');
23-
});
24+
}));
2425
return;
2526
}
2627

@@ -29,10 +30,10 @@ const options = {
2930
cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`),
3031
};
3132

32-
const server = tls.createServer(options, function(s) {
33+
const server = tls.createServer(options, common.mustCall(function(s) {
3334
s.end('bye');
3435
server.close();
35-
}).listen(0, common.mustCall(function() {
36+
})).listen(0, common.mustCall(function() {
3637
const env = {
3738
CHILD: 'yes',
3839
PORT: this.address().port,

0 commit comments

Comments
 (0)