Browse Source

test: refactor test-tls-destroy-whilst-write

Update var to let/const and replace arbitrary timeout.

PR-URL: https://github.com/nodejs/node/pull/10064
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
v4.x
Chris Bystrek 8 years ago
committed by Myles Borins
parent
commit
cff80a5c0e
  1. 14
      test/parallel/test-tls-destroy-whilst-write.js

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

@ -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() {

Loading…
Cancel
Save