Skip to content

Commit f7a30be

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 cbe054c commit f7a30be

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

doc/api/test.md

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

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

30293047
<!-- YAML

0 commit comments

Comments
 (0)