From 35ae48c2a7da50ee1019d6a0aaa99f2bd2c868d3 Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Fri, 26 May 2017 23:08:09 -0400 Subject: [PATCH] test: refreshTmpDir for test-fs-watchfile.js --- test/parallel/test-fs-watchfile.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-fs-watchfile.js b/test/parallel/test-fs-watchfile.js index fe22f93a10e044..be0be8f4856c38 100644 --- a/test/parallel/test-fs-watchfile.js +++ b/test/parallel/test-fs-watchfile.js @@ -64,9 +64,12 @@ fs.watchFile(enoentFile, {interval: 0}, common.mustCall(function(curr, prev) { } }, 2)); +common.refreshTmpDir(); + // Watch events should callback with a filename on supported systems if (common.isLinux || common.isOSX || common.isWindows || common.isAix) { const dir = common.tmpDir + '/watch'; + const file = `${dir}/foo.txt`; fs.mkdir(dir, common.mustCall(function(err) { if (err) assert.fail(err); @@ -76,7 +79,7 @@ if (common.isLinux || common.isOSX || common.isWindows || common.isAix) { assert.strictEqual(filename, 'foo.txt'); })); - fs.writeFile(`${dir}/foo.txt`, 'foo', common.mustCall(function(err) { + fs.writeFile(file, 'foo', common.mustCall(function(err) { if (err) assert.fail(err); })); }));