Skip to content

Commit 2f9c8d9

Browse files
Trottevanlucas
authored andcommittedDec 14, 2016
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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
'use strict';
22
const common = require('../common');
3-
var http = require('http');
3+
const http = require('http');
44

5-
var server = http.Server(function(req, res) {
5+
const server = 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-
var opts = {
12+
const opts = {
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)
Please sign in to comment.