From 048478d351aac6800f4300aa092bdc3416ac82df 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. PR-URL: https://github.com/nodejs/node/pull/53169 Refs: https://github.com/nodejs/node/pull/52860 Reviewed-By: Moshe Atlow Reviewed-By: Benjamin Gruenbaum Reviewed-By: Geoffrey Booth --- doc/api/test.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/api/test.md b/doc/api/test.md index c2d0514a3e6a0a..21860fb1925a62 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -3014,6 +3014,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)`