Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
fixup
  • Loading branch information
BridgeAR committed Mar 6, 2018
commit 697c2e3b8d526f7471de879858f8ffc1674a8b32
8 changes: 4 additions & 4 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ changes:
Asserts that the function `block` does not throw an error. See
[`assert.throws()`][] for more details.

Please note: Using `assert.doesNotThrow()` is not recommended because there is
no benefit by catching an error and then rethrowing it. Instead, consider adding
a comment next to the specific code path that should not throw and keep all
error messages in your code as expressive as possible.
Please note: Using `assert.doesNotThrow()` is actually not useful because there
is no benefit by catching an error and then rethrowing it. Instead, consider
adding a comment next to the specific code path that should not throw and keep
error messages as expressive as possible.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested rewording ...

The `assert.doesNotThrow()` method is not as useful in practice as it may
first appear. Consider, instead, adding comments to the specific code paths
that should not throw errors and keep error messages as expressive as possible.


When `assert.doesNotThrow()` is called, it will immediately call the `block`
function.
Expand Down