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 <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
  • Loading branch information
cjihrig authored and marco-ippolito committed Jul 19, 2024
1 parent a03a4c7 commit 394e00f
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 @@ -2880,6 +2880,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 394e00f

Please sign in to comment.