test: remove unneeded escaping in template strings

The no-useless-escape rule in ESLint did not previously flag certain
unnecessary escaping in template strings. These will be flagged in
ESLint 3.8.0.

PR-URL: https://github.com/nodejs/node/pull/9112
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
This commit is contained in:
Rich Trott 2016-10-15 12:16:42 -07:00
parent 3f05b67984
commit 150dc5c2e6
4 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ interfacer.on('line', function(line) {
} }
} else { } else {
line = line.replace(/^(debug> *)+/, ''); line = line.replace(/^(debug> *)+/, '');
expected = `(node:${pid}) Target process: 655555 doesn\'t exist.`; expected = `(node:${pid}) Target process: 655555 doesn't exist.`;
} }
assert.strictEqual(expected, line); assert.strictEqual(expected, line);

View File

@ -20,7 +20,7 @@ const base = require('./tick-processor-base.js');
base.runTest({ base.runTest({
pattern: /RunInDebugContext/, pattern: /RunInDebugContext/,
code: `function f() { code: `function f() {
require(\'vm\').runInDebugContext(\'Debug\'); require('vm').runInDebugContext('Debug');
setImmediate(function() { f(); }); setImmediate(function() { f(); });
}; };
f();` f();`

View File

@ -6,7 +6,7 @@ const spawnSync = require('child_process').spawnSync;
const Buffer = require('buffer').Buffer; const Buffer = require('buffer').Buffer;
function getSource(tag) { function getSource(tag) {
return `(function ${tag}() { return \'${tag}\'; })`; return `(function ${tag}() { return '${tag}'; })`;
} }
function produce(source, count) { function produce(source, count) {

View File

@ -48,7 +48,7 @@ var msgBuf = Buffer.from(msg + '\n');
// console.log ends every line with just '\n', even on Windows. // console.log ends every line with just '\n', even on Windows.
cmd = `"${process.execPath}" -e "console.log(\'${msg}\');"`; cmd = `"${process.execPath}" -e "console.log('${msg}');"`;
ret = execSync(cmd); ret = execSync(cmd);