Skip to content

Commit 394e00f

Browse files
cjihrigmarco-ippolito
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 <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
1 parent a03a4c7 commit 394e00f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

doc/api/test.md

+18
Original file line numberDiff line numberDiff line change
@@ -2880,6 +2880,24 @@ test('top level test', async (t) => {
28802880
});
28812881
```
28822882

2883+
### `context.assert`
2884+
2885+
<!-- YAML
2886+
added:
2887+
- v22.2.0
2888+
-->
2889+
2890+
An object containing assertion methods bound to `context`. The top-level
2891+
functions from the `node:assert` module are exposed here for the purpose of
2892+
creating test plans.
2893+
2894+
```js
2895+
test('test', (t) => {
2896+
t.plan(1);
2897+
t.assert.strictEqual(true, true);
2898+
});
2899+
```
2900+
28832901
### `context.diagnostic(message)`
28842902

28852903
<!-- YAML

0 commit comments

Comments
 (0)