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.

Refs: #52860
  • Loading branch information
cjihrig committed May 28, 2024
1 parent d5b7927 commit 970e274
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 @@ -3030,6 +3030,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 970e274

Please sign in to comment.