@@ -2089,48 +2089,6 @@ argument, then `error` is assumed to be omitted and the string will be used for
2089
2089
example in [ ` assert.throws() ` ] [ ] carefully if using a string as the second
2090
2090
argument gets considered.
2091
2091
2092
- ## ` assert.snapshot(value, name) `
2093
-
2094
- <!-- YAML
2095
- added: v18.8.0
2096
- -->
2097
-
2098
- > Stability: 1 - Experimental
2099
-
2100
- * ` value ` {any} the value to snapshot.
2101
- * ` name ` {string} the name of the snapshot.
2102
- * Returns: {Promise}
2103
-
2104
- Reads the ` name ` snapshot from a file and compares ` value ` to the snapshot.
2105
- ` value ` is serialized with [ ` util.inspect() ` ] [ ] . If the value is not strictly
2106
- equal to the snapshot, ` assert.snapshot() ` returns a rejected ` Promise ` with an
2107
- [ ` AssertionError ` ] [ ] .
2108
-
2109
- The snapshot filename uses the same basename as the application's main
2110
- entrypoint with a ` .snapshot ` extension. If the snapshot file does not exist,
2111
- it is created. The [ ` --update-assert-snapshot ` ] [ ] command line flag can be used
2112
- to force the update of an existing snapshot.
2113
-
2114
- ``` mjs
2115
- import assert from ' node:assert/strict' ;
2116
-
2117
- // Assuming that the application's main entrypoint is app.mjs, this reads the
2118
- // 'snapshotName' snapshot from app.snapshot and strictly compares its value
2119
- // to `util.inspect('value')`.
2120
- await assert .snapshot (' value' , ' snapshotName' );
2121
- ```
2122
-
2123
- ``` cjs
2124
- const assert = require (' node:assert/strict' );
2125
-
2126
- (async () => {
2127
- // Assuming that the application's main entrypoint is app.js, this reads the
2128
- // 'snapshotName' snapshot from app.snapshot and strictly compares its value
2129
- // to `util.inspect('value')`.
2130
- await assert .snapshot (' value' , ' snapshotName' );
2131
- })();
2132
- ```
2133
-
2134
2092
## ` assert.strictEqual(actual, expected[, message]) `
2135
2093
2136
2094
<!-- YAML
@@ -2567,7 +2525,6 @@ argument.
2567
2525
[ Object wrappers ] : https://developer.mozilla.org/en-US/docs/Glossary/Primitive#Primitive_wrapper_objects_in_JavaScript
2568
2526
[ Object.prototype.toString() ] : https://tc39.github.io/ecma262/#sec-object.prototype.tostring
2569
2527
[ `!=` operator ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality
2570
- [ `--update-assert-snapshot` ] : cli.md#--update-assert-snapshot
2571
2528
[ `===` operator ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality
2572
2529
[ `==` operator ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality
2573
2530
[ `AssertionError` ] : #class-assertassertionerror
@@ -2599,6 +2556,5 @@ argument.
2599
2556
[ `process.on('exit')` ] : process.md#event-exit
2600
2557
[ `tracker.calls()` ] : #trackercallsfn-exact
2601
2558
[ `tracker.verify()` ] : #trackerverify
2602
- [ `util.inspect()` ] : util.md#utilinspectobject-options
2603
2559
[ enumerable "own" properties ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties
2604
2560
[ prototype-spec ] : https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots
0 commit comments