Skip to content

Commit 048478d

Browse files
cjihrigtargos
authored andcommitted
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. PR-URL: #53169 Refs: #52860 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]>
1 parent f6d2af8 commit 048478d

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
@@ -3014,6 +3014,24 @@ test('top level test', async (t) => {
30143014
});
30153015
```
30163016

3017+
### `context.assert`
3018+
3019+
<!-- YAML
3020+
added:
3021+
- v22.2.0
3022+
-->
3023+
3024+
An object containing assertion methods bound to `context`. The top-level
3025+
functions from the `node:assert` module are exposed here for the purpose of
3026+
creating test plans.
3027+
3028+
```js
3029+
test('test', (t) => {
3030+
t.plan(1);
3031+
t.assert.strictEqual(true, true);
3032+
});
3033+
```
3034+
30173035
### `context.diagnostic(message)`
30183036

30193037
<!-- YAML

0 commit comments

Comments
 (0)