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: nodejs#53169
Refs: nodejs#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 eliphazbouye committed Jun 20, 2024
1 parent 66ccac2 commit d744dc9
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 @@ -3027,6 +3027,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 d744dc9

Please sign in to comment.