| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 877ab97 commit 15cc9b0
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1111,6 +1111,21 @@ if the `asyncFn` fails to reject. | |||
| 1111 | 1111 | })(); | |
| 1112 | 1112 | ``` | |
| 1113 | 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 | + | ||
| 1114 | 1129 | ```js | |
| 1115 | 1130 | assert.rejects( | |
| 1116 | 1131 | Promise.reject(new Error('Wrong value')), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments