Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc: fix markdown for expectFailure values
  • Loading branch information
JakobJingleheimer committed Mar 4, 2026
commit 836ffe44a61bba1e720e84d31aaa28f46e68c3c3
19 changes: 10 additions & 9 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,16 @@ it('should do the thing', { expectFailure: 'feature not implemented' }, () => {
```

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

Each of the following tests fails _despite_ being flagged `expectFailure`
because the failure does not match the specific **expected** failure.
[`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp),
[`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function),
[`Object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object),
or
[`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error),
the tests will pass only if they throw a matching value. See [`assert.throws`][] for how each value
type is handled.

Each of the following tests fails _despite_ being flagged `expectFailure` because the failure does
not match the specific **expected** failure.

```js
it('fails because regex does not match', {
Expand Down
Loading