summaryrefslogtreecommitdiff
path: root/test/sequential/test-child-process-execsync.js
diff options
context:
space:
mode:
authorMyles Borins <mborins@us.ibm.com>2015-10-12 21:26:50 -0700
committerJames M Snell <jasnell@gmail.com>2015-10-14 10:02:47 -0700
commit6c032a8333c7be3e5de64d6a673db9bb030d8b7a (patch)
tree2533631db984d624439d8496f0c4f01a99d9f0c6 /test/sequential/test-child-process-execsync.js
parentab03635fb1fd9d380d214116d2ba5bd96b2b9311 (diff)
downloadandroid-node-v8-6c032a8333c7be3e5de64d6a673db9bb030d8b7a.tar.gz
android-node-v8-6c032a8333c7be3e5de64d6a673db9bb030d8b7a.tar.bz2
android-node-v8-6c032a8333c7be3e5de64d6a673db9bb030d8b7a.zip
test: replace util with backtick strings
Now that we have backticks we no longer need to use util.format to template strings! This commit was inspired by #3324, and it replaces instances of util.format with backtick strings in a number of tests Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/3359
Diffstat (limited to 'test/sequential/test-child-process-execsync.js')
-rw-r--r--test/sequential/test-child-process-execsync.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/sequential/test-child-process-execsync.js b/test/sequential/test-child-process-execsync.js
index 07b6ba4c34..0bc4e02c65 100644
--- a/test/sequential/test-child-process-execsync.js
+++ b/test/sequential/test-child-process-execsync.js
@@ -1,7 +1,6 @@
'use strict';
var common = require('../common');
var assert = require('assert');
-var util = require('util');
var os = require('os');
var execSync = require('child_process').execSync;
@@ -13,10 +12,10 @@ var SLEEP = 2000;
var start = Date.now();
var err;
var caught = false;
+
try
{
- var cmd = util.format('"%s" -e "setTimeout(function(){}, %d);"',
- process.execPath, SLEEP);
+ var cmd = `"${process.execPath}" -e "setTimeout(function(){}, ${SLEEP});"`;
var ret = execSync(cmd, {timeout: TIMER});
} catch (e) {
caught = true;
@@ -38,7 +37,8 @@ var msg = 'foobar';
var msgBuf = new Buffer(msg + '\n');
// console.log ends every line with just '\n', even on Windows.
-cmd = util.format('"%s" -e "console.log(\'%s\');"', process.execPath, msg);
+
+cmd = `"${process.execPath}" -e "console.log(\'${msg}\');"`;
var ret = execSync(cmd);
@@ -51,7 +51,7 @@ assert.strictEqual(ret, msg + '\n', 'execSync encoding result should match');
var args = [
'-e',
- util.format('console.log("%s");', msg)
+ `console.log("${msg}");`
];
ret = execFileSync(process.execPath, args);