summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-get-pipeline-problem.js
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-04-28 04:06:42 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-05-05 17:39:05 +0300
commit8b76c3e60c7b5c274c757257580a2c0faae69097 (patch)
treea9f686995887dbeb0b5c5b23c5f3188987c99b2e /test/parallel/test-http-get-pipeline-problem.js
parent6bcf65d4a788a73b3c3f27d75796609f948f7885 (diff)
downloadandroid-node-v8-8b76c3e60c7b5c274c757257580a2c0faae69097.tar.gz
android-node-v8-8b76c3e60c7b5c274c757257580a2c0faae69097.tar.bz2
android-node-v8-8b76c3e60c7b5c274c757257580a2c0faae69097.zip
test: reduce string concatenations
PR-URL: https://github.com/nodejs/node/pull/12735 Refs: https://github.com/nodejs/node/pull/12455 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'test/parallel/test-http-get-pipeline-problem.js')
-rw-r--r--test/parallel/test-http-get-pipeline-problem.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/parallel/test-http-get-pipeline-problem.js b/test/parallel/test-http-get-pipeline-problem.js
index 762100511a..8439f80a07 100644
--- a/test/parallel/test-http-get-pipeline-problem.js
+++ b/test/parallel/test-http-get-pipeline-problem.js
@@ -32,9 +32,9 @@ http.globalAgent.maxSockets = 1;
common.refreshTmpDir();
-const image = fs.readFileSync(common.fixturesDir + '/person.jpg');
+const image = fs.readFileSync(`${common.fixturesDir}/person.jpg`);
-console.log('image.length = ' + image.length);
+console.log(`image.length = ${image.length}`);
const total = 10;
let requests = 0;
@@ -67,12 +67,12 @@ server.listen(0, function() {
};
http.get(opts, function(res) {
- console.error('recv ' + x);
- const s = fs.createWriteStream(common.tmpDir + '/' + x + '.jpg');
+ console.error(`recv ${x}`);
+ const s = fs.createWriteStream(`${common.tmpDir}/${x}.jpg`);
res.pipe(s);
s.on('finish', function() {
- console.error('done ' + x);
+ console.error(`done ${x}`);
if (++responses === total) {
checkFiles();
}
@@ -93,12 +93,12 @@ function checkFiles() {
assert(total <= files.length);
for (let i = 0; i < total; i++) {
- const fn = i + '.jpg';
- assert.ok(files.includes(fn), "couldn't find '" + fn + "'");
- const stat = fs.statSync(common.tmpDir + '/' + fn);
- assert.strictEqual(image.length, stat.size,
- "size doesn't match on '" + fn +
- "'. Got " + stat.size + ' bytes');
+ const fn = `${i}.jpg`;
+ assert.ok(files.includes(fn), `couldn't find '${fn}'`);
+ const stat = fs.statSync(`${common.tmpDir}/${fn}`);
+ assert.strictEqual(
+ image.length, stat.size,
+ `size doesn't match on '${fn}'. Got ${stat.size} bytes`);
}
checkedFiles = true;