Skip to content

Commit

Permalink
doc: add context.assert docs
Browse files Browse the repository at this point in the history
When context.assert was added, no docs were added. This commit
adds initial documentation for context.assert because the
snapshot() function requires them.

PR-URL: #53169
Refs: #52860
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
  • Loading branch information
cjihrig authored and targos committed Jun 1, 2024
1 parent f6d2af8 commit 048478d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -3014,6 +3014,24 @@ test('top level test', async (t) => {
});
```

### `context.assert`

<!-- YAML
added:
- v22.2.0
-->

An object containing assertion methods bound to `context`. The top-level
functions from the `node:assert` module are exposed here for the purpose of
creating test plans.

```js
test('test', (t) => {
t.plan(1);
t.assert.strictEqual(true, true);
});
```

### `context.diagnostic(message)`

<!-- YAML
Expand Down

0 comments on commit 048478d

Please sign in to comment.