From 970e27425fbd622fea047436c84a90d700c1b5ae Mon Sep 17 00:00:00 2001 From: cjihrig Date: Mon, 27 May 2024 12:59:15 -0400 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/52860 --- doc/api/test.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/api/test.md b/doc/api/test.md index f5117445583aab..5300021aa78627 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -3030,6 +3030,24 @@ test('top level test', async (t) => { }); ``` +### `context.assert` + + + +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)`