| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b85a11c commit fe65996
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -312,6 +312,18 @@ assert.throws( | |||
| 312 | 312 | ); | |
| 313 | 313 | ``` | |
| 314 | 314 | ||
| 315 | + In the case of internal errors, prefer checking only the `code` property: | ||
| 316 | + | ||
| 317 | + ```js | ||
| 318 | + assert.throws( | ||
| 319 | + () => { | ||
| 320 | + throw new ERR_FS_FILE_TOO_LARGE(`${sizeKiB} Kb`); | ||
| 321 | + }, | ||
| 322 | + { code: 'ERR_FS_FILE_TOO_LARGE' } | ||
| 323 | + // Do not include message: /^File size ([0-9]+ Kb) is greater than 2 GiB$/ | ||
| 324 | + ); | ||
| 325 | + ``` | ||
| 326 | + | ||
| 315 | 327 | ### Console output | |
| 316 | 328 | ||
| 317 | 329 | Output written by tests to stdout or stderr, such as with `console.log()` or | |
| Back | FazBrowse Home | New Git URL |
0 commit comments