diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-03-13 22:43:00 +0800 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2019-04-27 11:36:04 +0200 |
commit | dd709fc84a6c04408221d096ca8e738b8fe4e870 (patch) | |
tree | ed2b102c70d1f2613593f326615afed991c846de /test/sequential | |
parent | 453510c7ef7dae452a44da2752084c1d08246a61 (diff) | |
download | node-new-dd709fc84a6c04408221d096ca8e738b8fe4e870.tar.gz |
lib: throw a special error in internal/assert
Instead of using the public AssertionError, use a simplified
error that describes potential causes of these assertions
and suggests the user to open an issue.
PR-URL: https://github.com/nodejs/node/pull/26635
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'test/sequential')
-rw-r--r-- | test/sequential/test-fs-watch.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/sequential/test-fs-watch.js b/test/sequential/test-fs-watch.js index a67de8c6d1..fd0788dac9 100644 --- a/test/sequential/test-fs-watch.js +++ b/test/sequential/test-fs-watch.js @@ -115,14 +115,14 @@ tmpdir.refresh(); // https://github.com/joyent/node/issues/6690 { let oldhandle; - assert.throws(() => { - const w = fs.watch(__filename, common.mustNotCall()); - oldhandle = w._handle; - w._handle = { close: w._handle.close }; - w.close(); - }, { - message: 'handle must be a FSEvent', - code: 'ERR_ASSERTION' - }); + common.expectsInternalAssertion( + () => { + const w = fs.watch(__filename, common.mustNotCall()); + oldhandle = w._handle; + w._handle = { close: w._handle.close }; + w.close(); + }, + 'handle must be a FSEvent' + ); oldhandle.close(); // clean up } |