Skip to content

Commit 35ae48c

Browse files
committed
test: refreshTmpDir for test-fs-watchfile.js
1 parent 2db6556 commit 35ae48c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parallel/test-fs-watchfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ fs.watchFile(enoentFile, {interval: 0}, common.mustCall(function(curr, prev) {
6464
}
6565
}, 2));
6666

67+
common.refreshTmpDir();
68+
6769
// Watch events should callback with a filename on supported systems
6870
if (common.isLinux || common.isOSX || common.isWindows || common.isAix) {
6971
const dir = common.tmpDir + '/watch';
72+
const file = `${dir}/foo.txt`;
7073

7174
fs.mkdir(dir, common.mustCall(function(err) {
7275
if (err) assert.fail(err);
@@ -76,7 +79,7 @@ if (common.isLinux || common.isOSX || common.isWindows || common.isAix) {
7679
assert.strictEqual(filename, 'foo.txt');
7780
}));
7881

79-
fs.writeFile(`${dir}/foo.txt`, 'foo', common.mustCall(function(err) {
82+
fs.writeFile(file, 'foo', common.mustCall(function(err) {
8083
if (err) assert.fail(err);
8184
}));
8285
}));

0 commit comments

Comments
 (0)