diff --git a/doc/api/assert.md b/doc/api/assert.md index a77dd196e0063b..9a0a65008f066f 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -2089,48 +2089,6 @@ argument, then `error` is assumed to be omitted and the string will be used for example in [`assert.throws()`][] carefully if using a string as the second argument gets considered. -## `assert.snapshot(value, name)` - - - -> Stability: 1 - Experimental - -* `value` {any} the value to snapshot. -* `name` {string} the name of the snapshot. -* Returns: {Promise} - -Reads the `name` snapshot from a file and compares `value` to the snapshot. -`value` is serialized with [`util.inspect()`][]. If the value is not strictly -equal to the snapshot, `assert.snapshot()` returns a rejected `Promise` with an -[`AssertionError`][]. - -The snapshot filename uses the same basename as the application's main -entrypoint with a `.snapshot` extension. If the snapshot file does not exist, -it is created. The [`--update-assert-snapshot`][] command line flag can be used -to force the update of an existing snapshot. - -```mjs -import assert from 'node:assert/strict'; - -// Assuming that the application's main entrypoint is app.mjs, this reads the -// 'snapshotName' snapshot from app.snapshot and strictly compares its value -// to `util.inspect('value')`. -await assert.snapshot('value', 'snapshotName'); -``` - -```cjs -const assert = require('node:assert/strict'); - -(async () => { - // Assuming that the application's main entrypoint is app.js, this reads the - // 'snapshotName' snapshot from app.snapshot and strictly compares its value - // to `util.inspect('value')`. - await assert.snapshot('value', 'snapshotName'); -})(); -``` - ## `assert.strictEqual(actual, expected[, message])` - -Updates snapshot files used by [`assert.snapshot()`][]. - ### `--use-bundled-ca`, `--use-openssl-ca`