Skip to content

Commit 970e274

Browse files
committed
doc: add context.assert docs
When context.assert was added, no docs were added. This commit adds initial documentation for context.assert because the snapshot() function requires them. Refs: nodejs#52860
1 parent d5b7927 commit 970e274

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

doc/api/test.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3030,6 +3030,24 @@ test('top level test', async (t) => {
30303030
});
30313031
```
30323032

3033+
### `context.assert`
3034+
3035+
<!-- YAML
3036+
added:
3037+
- v22.2.0
3038+
-->
3039+
3040+
An object containing assertion methods bound to `context`. The top-level
3041+
functions from the `node:assert` module are exposed here for the purpose of
3042+
creating test plans.
3043+
3044+
```js
3045+
test('test', (t) => {
3046+
t.plan(1);
3047+
t.assert.strictEqual(true, true);
3048+
});
3049+
```
3050+
30333051
### `context.diagnostic(message)`
30343052

30353053
<!-- YAML

0 commit comments

Comments
 (0)