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