Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db516ec

Browse filesBrowse files
JakobJingleheimeraduh95
authored andcommitted
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 5245900 commit db516ec
Copy full SHA for db516ec

1 file changed

+2-10Lines changed: 2 additions & 10 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/test.md‎

Copy file name to clipboardExpand all lines: doc/api/test.md
+2-10Lines changed: 2 additions & 10 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,7 @@ it('should do the thing', { expectFailure: 'feature not implemented' }, () => {
286286
});
287287
```
288288

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

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.