summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-pause-resume-one-end.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-12-09 16:08:05 -0800
committerRich Trott <rtrott@gmail.com>2016-12-13 16:30:30 -0800
commit6f02957846e91729606ecf00c2042ef1a4890dce (patch)
tree67ea9364c48cd19421d574ec4156a696f6e213c3 /test/parallel/test-http-pause-resume-one-end.js
parent3ddbea64553e715f1ffa060fea55826622deacaa (diff)
downloadandroid-node-v8-6f02957846e91729606ecf00c2042ef1a4890dce.tar.gz
android-node-v8-6f02957846e91729606ecf00c2042ef1a4890dce.tar.bz2
android-node-v8-6f02957846e91729606ecf00c2042ef1a4890dce.zip
test: refactor test-http-pause-resume-one-end
* setTimeout() with no duration -> setImmediate() * var -> const * remove unused variable `chunk` PR-URL: https://github.com/nodejs/node/pull/10210 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'test/parallel/test-http-pause-resume-one-end.js')
-rw-r--r--test/parallel/test-http-pause-resume-one-end.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/parallel/test-http-pause-resume-one-end.js b/test/parallel/test-http-pause-resume-one-end.js
index 2ebd3cbe61..6b98246cc2 100644
--- a/test/parallel/test-http-pause-resume-one-end.js
+++ b/test/parallel/test-http-pause-resume-one-end.js
@@ -1,23 +1,23 @@
'use strict';
const common = require('../common');
-var http = require('http');
+const http = require('http');
-var server = http.Server(function(req, res) {
+const server = http.Server(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
server.close();
});
server.listen(0, common.mustCall(function() {
- var opts = {
+ const opts = {
port: this.address().port,
headers: { connection: 'close' }
};
http.get(opts, common.mustCall(function(res) {
- res.on('data', common.mustCall(function(chunk) {
+ res.on('data', common.mustCall(function() {
res.pause();
- setTimeout(function() {
+ setImmediate(function() {
res.resume();
});
}));