Skip to content

Commit 23ba205

Browse files
doc: fix markdown for expectFailure values
PR-URL: #62100 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
1 parent 330e3ee commit 23ba205

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

doc/api/test.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,7 @@ it('should do the thing', { expectFailure: 'feature not implemented' }, () => {
287287
});
288288
```
289289

290-
If the value of `expectFailure` is a
291-
[<RegExp>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) |
292-
[<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) |
293-
[<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) |
294-
[<Error>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error),
290+
If the value of `expectFailure` is a {RegExp|Function|Object|Error}
295291
the tests will pass only if they throw a matching value.
296292
See [`assert.throws`][] for how each value type is handled.
297293

@@ -1734,11 +1730,7 @@ changes:
17341730
**Default:** `false`.
17351731
* `expectFailure` {boolean|string|RegExp|Function|Object|Error} If truthy, the
17361732
test is expected to fail. If a non-empty string is provided, that string is displayed
1737-
in the test results as the reason why the test is expected to fail. If a
1738-
[<RegExp>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp),
1739-
[<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function),
1740-
[<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object), or
1741-
[<Error>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)
1733+
in the test results as the reason why the test is expected to fail. If a {RegExp|Function|Object|Error}
17421734
is provided directly (without wrapping in `{ match: … }`), the test passes
17431735
only if the thrown error matches, following the behavior of
17441736
[`assert.throws`][]. To provide both a reason and validation, pass an object

0 commit comments

Comments
 (0)