diff --git a/doc/api/assert.md b/doc/api/assert.md index 5ca1f0830853b8..6728a819d3ba9e 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -330,6 +330,11 @@ changes: Asserts that the function `block` does not throw an error. See [`assert.throws()`][] for more details. +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. + When `assert.doesNotThrow()` is called, it will immediately call the `block` function.