Skip to content

Commit c456ca3

Browse files
cBystFishrock123
authored andcommitted
test: refactor test-tls-destroy-whilst-write
Update var to let/const and replace arbitrary timeout. PR-URL: #10064 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent fd17ca7 commit c456ca3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎test/parallel/test-tls-destroy-whilst-write.js‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
'use strict';
2-
varcommon=require('../common');
2+
constcommon=require('../common');
33

44
if(!common.hasCrypto){
55
common.skip('missing crypto');
66
return;
77
}
8-
vartls=require('tls');
9-
varstream=require('stream');
8+
consttls=require('tls');
9+
conststream=require('stream');
1010

11-
vardelay=newstream.Duplex({
11+
constdelay=newstream.Duplex({
1212
read: functionread(){
1313
},
1414
write: functionwrite(data,enc,cb){
1515
console.log('pending');
16-
setTimeout(function(){
16+
setImmediate(function(){
1717
console.log('done');
1818
cb();
19-
},200);
19+
});
2020
}
2121
});
2222

23-
varsecure=tls.connect({
23+
constsecure=tls.connect({
2424
socket: delay
2525
});
2626
setImmediate(function(){

0 commit comments

Comments
(0)