Commit 0d241ba
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
Backport-PR-URL: #24019
PR-URL: #19650
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>1 parent 3cd4462 commit 0d241baCopy full SHA for 0d241ba
File tree
Expand file treeCollapse file tree
2 files changed
+18
-2
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+18
-2
lines changedOpen diff view settings
Collapse file
+4-1Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
722 | 722 | |
723 | 723 | |
724 | 724 | |
| 725 | + |
| 726 | + |
| 727 | + |
725 | 728 | |
726 | | - |
| 729 | + |
727 | 730 | |
728 | 731 | |
729 | 732 | |
|
Collapse file
test/parallel/test-assert-async.js
Copy file name to clipboardExpand all lines: test/parallel/test-assert-async.js+14-1Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
13 | 13 | |
14 | 14 | |
15 | 15 | |
16 | | - |
| 16 | + |
17 | 17 | |
18 | 18 | |
19 | 19 | |
| ||
57 | 57 | |
58 | 58 | |
59 | 59 | |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
60 | 73 | |
0 commit comments