Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c456ca3

Browse filesBrowse 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 <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent fd17ca7 commit c456ca3
Copy full SHA for c456ca3

File tree

Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-tls-destroy-whilst-write.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
'use strict';
2-
var common = require('../common');
2+
const common = require('../common');
33

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

11-
var delay = new stream.Duplex({
11+
const delay = new stream.Duplex({
1212
read: function read() {
1313
},
1414
write: function write(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-
var secure = tls.connect({
23+
const secure = tls.connect({
2424
socket: delay
2525
});
2626
setImmediate(function() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.