Skip to content

Commit a767367

Browse files
Trottaddaleax
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 12b6765 commit a767367

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

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

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

1617
if(process.env.CHILD){
1718
constcopts={
1819
port: process.env.PORT,
19-
checkServerIdentity: common.noop,
20+
checkServerIdentity: common.mustCall(),
2021
};
21-
constclient=tls.connect(copts,function(){
22+
constclient=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-
constserver=tls.createServer(options,function(s){
33+
constserver=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
constenv={
3738
CHILD: 'yes',
3839
PORT: this.address().port,

0 commit comments

Comments
(0)