Skip to content

Commit

Permalink
test: refactor test-tls-destroy-whilst-write
Browse files Browse the repository at this point in the history
Update var to let/const and replace arbitrary timeout.

PR-URL: #10064
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
  • Loading branch information
cByst authored and addaleax committed Dec 8, 2016
1 parent 1c3227f commit 5d28864
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/parallel/test-tls-destroy-whilst-write.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
'use strict';
var common = require('../common');
const common = require('../common');

if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
var tls = require('tls');
var stream = require('stream');
const tls = require('tls');
const stream = require('stream');

var delay = new stream.Duplex({
const delay = new stream.Duplex({
read: function read() {
},
write: function write(data, enc, cb) {
console.log('pending');
setTimeout(function() {
setImmediate(function() {
console.log('done');
cb();
}, 200);
});
}
});

var secure = tls.connect({
const secure = tls.connect({
socket: delay
});
setImmediate(function() {
Expand Down

0 comments on commit 5d28864

Please sign in to comment.