From 2c554a9d2be93c85fe1e02d0043aaffa59109477 Mon Sep 17 00:00:00 2001 From: sreepurnajasti Date: Thu, 28 Dec 2017 15:17:56 +0530 Subject: test: improve to use template string PR-URL: https://github.com/nodejs/node/pull/17895 Reviewed-By: Gibson Fahnestock Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- test/parallel/test-child-process-fork-net2.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/parallel/test-child-process-fork-net2.js b/test/parallel/test-child-process-fork-net2.js index 41ba49c24c..4729fe0573 100644 --- a/test/parallel/test-child-process-fork-net2.js +++ b/test/parallel/test-child-process-fork-net2.js @@ -12,7 +12,7 @@ if (process.argv[2] === 'child') { process.on('message', function(m, socket) { if (!socket) return; - console.error('[%d] got socket', id, m); + console.error(`[${id}] got socket ${m}`); // will call .end('end') or .write('write'); socket[m](m); @@ -20,11 +20,11 @@ if (process.argv[2] === 'child') { socket.resume(); socket.on('data', function() { - console.error('[%d] socket.data', id, m); + console.error(`[${id}] socket.data ${m}`); }); socket.on('end', function() { - console.error('[%d] socket.end', id, m); + console.error(`[${id}] socket.end ${m}`); }); // store the unfinished socket @@ -33,27 +33,27 @@ if (process.argv[2] === 'child') { } socket.on('close', function(had_error) { - console.error('[%d] socket.close', id, had_error, m); + console.error(`[${id}] socket.close ${had_error} ${m}`); }); socket.on('finish', function() { - console.error('[%d] socket finished', id, m); + console.error(`[${id}] socket finished ${m}`); }); }); process.on('message', function(m) { if (m !== 'close') return; - console.error('[%d] got close message', id); + console.error(`[${id}] got close message`); needEnd.forEach(function(endMe, i) { - console.error('[%d] ending %d/%d', id, i, needEnd.length); + console.error(`[${id}] ending ${i}/${needEnd.length}`); endMe.end('end'); }); }); process.on('disconnect', function() { - console.error('[%d] process disconnect, ending', id); + console.error(`[${id}] process disconnect, ending`); needEnd.forEach(function(endMe, i) { - console.error('[%d] ending %d/%d', id, i, needEnd.length); + console.error(`[${id}] ending ${i}/${needEnd.length}`); endMe.end('end'); }); }); @@ -86,7 +86,7 @@ if (process.argv[2] === 'child') { connected += 1; socket.once('close', function() { - console.log('[m] socket closed, total %d', ++closed); + console.log(`[m] socket closed, total ${++closed}`); }); if (connected === count) { -- cgit v1.2.1