diff --git a/test/parallel/test-fs-watchfile.js b/test/parallel/test-fs-watchfile.js index 35ac9b88e12893..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);