summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-watch-enoent.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-fs-watch-enoent.js')
-rw-r--r--test/parallel/test-fs-watch-enoent.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/parallel/test-fs-watch-enoent.js b/test/parallel/test-fs-watch-enoent.js
index e6db65993d..1ed9f2ed64 100644
--- a/test/parallel/test-fs-watch-enoent.js
+++ b/test/parallel/test-fs-watch-enoent.js
@@ -1,3 +1,4 @@
+// Flags: --expose-internals
'use strict';
// This verifies the error thrown by fs.watch.
@@ -8,7 +9,11 @@ const fs = require('fs');
const tmpdir = require('../common/tmpdir');
const path = require('path');
const nonexistentFile = path.join(tmpdir.path, 'non-existent');
-const uv = process.binding('uv');
+const { internalBinding } = require('internal/test/binding');
+const {
+ UV_ENODEV,
+ UV_ENOENT
+} = internalBinding('uv');
tmpdir.refresh();
@@ -21,13 +26,13 @@ tmpdir.refresh();
assert.strictEqual(
err.message,
`ENOENT: no such file or directory, watch '${nonexistentFile}'`);
- assert.strictEqual(err.errno, uv.UV_ENOENT);
+ assert.strictEqual(err.errno, UV_ENOENT);
assert.strictEqual(err.code, 'ENOENT');
} else { // AIX
assert.strictEqual(
err.message,
`ENODEV: no such device, watch '${nonexistentFile}'`);
- assert.strictEqual(err.errno, uv.UV_ENODEV);
+ assert.strictEqual(err.errno, UV_ENODEV);
assert.strictEqual(err.code, 'ENODEV');
}
return true;
@@ -50,7 +55,7 @@ tmpdir.refresh();
assert.strictEqual(
err.message,
`ENOENT: no such file or directory, watch '${nonexistentFile}'`);
- assert.strictEqual(err.errno, uv.UV_ENOENT);
+ assert.strictEqual(err.errno, UV_ENOENT);
assert.strictEqual(err.code, 'ENOENT');
assert.strictEqual(err.syscall, 'watch');
fs.unlinkSync(file);
@@ -60,5 +65,5 @@ tmpdir.refresh();
watcher.on('error', common.mustCall(validateError));
// Simulate the invocation from the binding
- watcher._handle.onchange(uv.UV_ENOENT, 'ENOENT', nonexistentFile);
+ watcher._handle.onchange(UV_ENOENT, 'ENOENT', nonexistentFile);
}