summaryrefslogtreecommitdiff
path: root/tests/node_compat/test/parallel/test-fs-watchfile.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/node_compat/test/parallel/test-fs-watchfile.js')
-rw-r--r--tests/node_compat/test/parallel/test-fs-watchfile.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/node_compat/test/parallel/test-fs-watchfile.js b/tests/node_compat/test/parallel/test-fs-watchfile.js
index 7419b276c..ccbaabe06 100644
--- a/tests/node_compat/test/parallel/test-fs-watchfile.js
+++ b/tests/node_compat/test/parallel/test-fs-watchfile.js
@@ -37,7 +37,7 @@ assert.throws(() => {
fs.watchFile(new Object(), common.mustNotCall());
}, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' });
-const enoentFile = path.join(tmpdir.path, 'non-existent-file');
+const enoentFile = tmpdir.resolve('non-existent-file');
const expectedStatObject = new fs.Stats(
0, // dev
0, // mode
@@ -92,14 +92,14 @@ watcher.on('stop', common.mustCall());
// 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 = path.join(tmpdir.path, 'watch');
+ const dir = tmpdir.resolve('watch');
fs.mkdir(dir, common.mustCall(function(err) {
if (err) assert.fail(err);
- fs.watch(dir, common.mustCall(function(eventType, filename) {
+ const handle = fs.watch(dir, common.mustCall(function(eventType, filename) {
clearInterval(interval);
- this._handle.close();
+ handle.close();
assert.strictEqual(filename, 'foo.txt');
}));