Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: use mustNotCall() in test-fs-watch
Use common.mustNotCall() in test/sequential/test-fs-watch.js in
situations where the call to watch() is expected to throw.
  • Loading branch information
Trott committed Jun 10, 2017
commit 9c6d2ae415b6e8780109f47f51a30c6373f4c63a
4 changes: 2 additions & 2 deletions test/sequential/test-fs-watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ fs.watch(__filename, {persistent: false}, function() {
// https://github.com/joyent/node/issues/6690
let oldhandle;
assert.throws(function() {
const w = fs.watch(__filename, common.noop);
const w = fs.watch(__filename, common.mustNotCall());
oldhandle = w._handle;
w._handle = { close: w._handle.close };
w.close();
}, /^TypeError: Illegal invocation$/);
oldhandle.close(); // clean up

assert.throws(function() {
const w = fs.watchFile(__filename, {persistent: false}, common.noop);
const w = fs.watchFile(__filename, {persistent: false}, common.mustNotCall());
oldhandle = w._handle;
w._handle = { stop: w._handle.stop };
w.stop();
Expand Down