We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06bc2de commit ab735d0Copy full SHA for ab735d0
doc/api/assert.md
@@ -1111,6 +1111,21 @@ if the `asyncFn` fails to reject.
1111
})();
1112
```
1113
1114
+```js
1115
+(async () => {
1116
+ await assert.rejects(
1117
+ async () => {
1118
+ throw new TypeError('Wrong value');
1119
+ },
1120
+ (err) => {
1121
+ assert.strictEqual(err.name, 'TypeError');
1122
+ assert.strictEqual(err.message, 'Wrong value');
1123
+ return true;
1124
+ }
1125
+ );
1126
+})();
1127
+```
1128
+
1129
```js
1130
assert.rejects(
1131
Promise.reject(new Error('Wrong value')),
0 commit comments