We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b85a11c commit fe65996Copy full SHA for fe65996
doc/contributing/writing-tests.md
@@ -312,6 +312,18 @@ assert.throws(
312
);
313
```
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
327
### Console output
328
329
Output written by tests to stdout or stderr, such as with `console.log()` or
0 commit comments