Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
assert: ensure .rejects() disallows sync throws
This updates `assert.rejects()` to disallow any errors that are thrown synchronously from the given function. Previously, throwing an error would cause the same behavior as returning a rejected Promise. Fixes: #19646 PR-URL: #19650 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
- Loading branch information
Showing
with
18 additions
and 2 deletions.
- +4 −1 lib/assert.js
- +14 −1 test/parallel/test-assert-async.js