Skip to content

doc(test): add missing passed and error on TextContext #59322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
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
17 changes: 17 additions & 0 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -3607,6 +3607,23 @@ added:

The name of the test.

### `context.passed` {boolean}

<!-- YAML
added: v20.12.0
-->

Indicates whether the test succeeded, this defaults to `true` before the test is executed, e.g. in a `beforeEach` hook.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you happen to know where this is set? The implementation you cited does not do this, and that behaviour seems wrong. I would expect context.passed to be nullish until there is something to report.


### `context.error` {Error|null}

<!-- YAML
added: v20.12.0
-->

The failure reason for this test, if a non `Error` object was thrown it will be wrapped and available via the `cause`
property.
Comment on lines +3624 to +3625
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The failure reason for this test, if a non `Error` object was thrown it will be wrapped and available via the `cause`
property.
The failure reason for the test/case; if anything other than an instance of `Error` was thrown, that will be wrapped and available via `context.error.cause`.

(line length may anger the linter)


### `context.plan(count[,options])`

<!-- YAML
Expand Down
Loading