diff options
Diffstat (limited to 'test/sequential/test-fs-watch.js')
-rw-r--r-- | test/sequential/test-fs-watch.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/sequential/test-fs-watch.js b/test/sequential/test-fs-watch.js index 91d750acd0..3c8ae0eba7 100644 --- a/test/sequential/test-fs-watch.js +++ b/test/sequential/test-fs-watch.js @@ -122,13 +122,20 @@ tmpdir.refresh(); code: 'ERR_ASSERTION' }); oldhandle.close(); // clean up +} - assert.throws(function() { - const w = fs.watchFile(__filename, { persistent: false }, +{ + let oldhandle; + assert.throws(() => { + const w = fs.watchFile(__filename, + { persistent: false }, common.mustNotCall()); oldhandle = w._handle; w._handle = { stop: w._handle.stop }; w.stop(); - }, /^TypeError: Illegal invocation$/); + }, { + message: 'handle must be a StatWatcher', + code: 'ERR_ASSERTION' + }); oldhandle.stop(); // clean up } |