From 58afe52c33183bc3a0bde3232a8e9e360e798958 Mon Sep 17 00:00:00 2001 From: Helianthus21 <740051540@qq.com> Date: Sun, 16 Jul 2017 15:56:25 +0800 Subject: [PATCH] test: replace string concat in test-fs-watchfile.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/14287 Reviewed-By: Joyee Cheung Reviewed-By: Rich Trott Reviewed-By: Michaël Zasso Reviewed-By: Gibson Fahnestock Reviewed-By: Benjamin Gruenbaum Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Gireesh Punathil Reviewed-By: Refael Ackermann Reviewed-By: James M Snell --- 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 778174c64095cc..e7f991767b1d00 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((err) => { if (err) assert.fail(err); })); }, 1);