From 4d76c6bf27c0a3af45cc1cdda5d9cb8b20d99251 Mon Sep 17 00:00:00 2001 From: Helianthus21 <740051540@qq.com> Date: Sun, 16 Jul 2017 15:56:25 +0800 Subject: [PATCH 1/3] test:replace string concatenation with template literals in test-fs-watchfile.js --- test/parallel/test-fs-watchfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-fs-watchfile.js b/test/parallel/test-fs-watchfile.js index 35ac9b88e12893..e668b882460003 100644 --- a/test/parallel/test-fs-watchfile.js +++ b/test/parallel/test-fs-watchfile.js @@ -67,7 +67,7 @@ fs.watchFile(enoentFile, {interval: 0}, common.mustCall(function(curr, prev) { // Watch events should callback with a filename on supported systems. // Omitting AIX. It works but not reliably. if (common.isLinux || common.isOSX || common.isWindows) { - const dir = common.tmpDir + '/watch'; + const dir = `${common.tmpDir}/watch'`; fs.mkdir(dir, common.mustCall(function(err) { if (err) assert.fail(err); From 2ec6bf4c1d141e2ece0a124df685f5ba908adc0f Mon Sep 17 00:00:00 2001 From: Helianthus21 <740051540@qq.com> Date: Sun, 16 Jul 2017 16:09:48 +0800 Subject: [PATCH 2/3] test: remove the last quote --- test/parallel/test-fs-watchfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-fs-watchfile.js b/test/parallel/test-fs-watchfile.js index e668b882460003..559c107a28ce85 100644 --- a/test/parallel/test-fs-watchfile.js +++ b/test/parallel/test-fs-watchfile.js @@ -67,7 +67,7 @@ fs.watchFile(enoentFile, {interval: 0}, common.mustCall(function(curr, prev) { // Watch events should callback with a filename on supported systems. // Omitting AIX. It works but not reliably. if (common.isLinux || common.isOSX || common.isWindows) { - const dir = `${common.tmpDir}/watch'`; + const dir = `${common.tmpDir}/watch`; fs.mkdir(dir, common.mustCall(function(err) { if (err) assert.fail(err); From ccdc806fbc0536b5f3a00e422a55eb95b46a7291 Mon Sep 17 00:00:00 2001 From: Vesper <740051540@qq.com> Date: Tue, 18 Jul 2017 09:20:18 +0800 Subject: [PATCH 3/3] test: use path.join to replace path string concatenation --- test/parallel/test-fs-watchfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-fs-watchfile.js b/test/parallel/test-fs-watchfile.js index 559c107a28ce85..7f51bcc6a74f7c 100644 --- a/test/parallel/test-fs-watchfile.js +++ b/test/parallel/test-fs-watchfile.js @@ -67,7 +67,7 @@ fs.watchFile(enoentFile, {interval: 0}, common.mustCall(function(curr, prev) { // Watch events should callback with a filename on supported systems. // Omitting AIX. It works but not reliably. if (common.isLinux || common.isOSX || common.isWindows) { - const dir = `${common.tmpDir}/watch`; + const dir = path.join(common.tmpDir, 'watch'); fs.mkdir(dir, common.mustCall(function(err) { if (err) assert.fail(err); @@ -79,7 +79,7 @@ if (common.isLinux || common.isOSX || common.isWindows) { })); const interval = setInterval(() => { - fs.writeFile(`${dir}/foo.txt`, 'foo', common.mustCall(function(err) { + fs.writeFile(path.join(dir, 'foo.txt'), 'foo', common.mustCall(function(err) { if (err) assert.fail(err); })); }, 1);