Skip to content

Commit 2f9c8d9

Browse files
Trottevanlucas
authored andcommitted
test: refactor test-http-pause-resume-one-end
* setTimeout() with no duration -> setImmediate() * var -> const * remove unused variable `chunk` PR-URL: #10210 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 90659bc commit 2f9c8d9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎test/parallel/test-http-pause-resume-one-end.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
'use strict';
22
constcommon=require('../common');
3-
varhttp=require('http');
3+
consthttp=require('http');
44

5-
varserver=http.Server(function(req,res){
5+
constserver=http.Server(function(req,res){
66
res.writeHead(200,{'Content-Type': 'text/plain'});
77
res.end('Hello World\n');
88
server.close();
99
});
1010

1111
server.listen(0,common.mustCall(function(){
12-
varopts={
12+
constopts={
1313
port: this.address().port,
1414
headers: {connection: 'close'}
1515
};
1616

1717
http.get(opts,common.mustCall(function(res){
18-
res.on('data',common.mustCall(function(chunk){
18+
res.on('data',common.mustCall(function(){
1919
res.pause();
20-
setTimeout(function(){
20+
setImmediate(function(){
2121
res.resume();
2222
});
2323
}));

0 commit comments

Comments
(0)