| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1834e94 commit 1352f08
22 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -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 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1490,14 +1490,6 @@ occurs. One of the following modes can be chosen: | |||
| 1490 | 1490 | If a rejection happens during the command line entry point's ES module static | |
| 1491 | 1491 | loading phase, it will always raise it as an uncaught exception. | |
| 1492 | 1492 | ||
| 1493 | - ### `--update-assert-snapshot` | ||
| 1494 | - | ||
| 1495 | - <!-- YAML | ||
| 1496 | - added: v18.8.0 | ||
| 1497 | - --> | ||
| 1498 | - | ||
| 1499 | - Updates snapshot files used by [`assert.snapshot()`][]. | ||
| 1500 | - | ||
| 1501 | 1493 | ### `--use-bundled-ca`, `--use-openssl-ca` | |
| 1502 | 1494 | ||
| 1503 | 1495 | <!-- YAML | |
@@ -1917,7 +1909,6 @@ Node.js options that are allowed are: | |||
| 1917 | 1909 | * `--trace-warnings` | |
| 1918 | 1910 | * `--track-heap-objects` | |
| 1919 | 1911 | * `--unhandled-rejections` | |
| 1920 | - * `--update-assert-snapshot` | ||
| 1921 | 1912 | * `--use-bundled-ca` | |
| 1922 | 1913 | * `--use-largepages` | |
| 1923 | 1914 | * `--use-openssl-ca` | |
@@ -2294,7 +2285,6 @@ done | |||
| 2294 | 2285 | [`NO_COLOR`]: https://no-color.org | |
| 2295 | 2286 | [`SlowBuffer`]: buffer.md#class-slowbuffer | |
| 2296 | 2287 | [`YoungGenerationSizeFromSemiSpaceSize`]: https://chromium.googlesource.com/v8/v8.git/+/refs/tags/10.3.129/src/heap/heap.cc#328 | |
| 2297 | - [`assert.snapshot()`]: assert.md#assertsnapshotvalue-name | ||
| 2298 | 2288 | [`dns.lookup()`]: dns.md#dnslookuphostname-options-callback | |
| 2299 | 2289 | [`dns.setDefaultResultOrder()`]: dns.md#dnssetdefaultresultorderorder | |
| 2300 | 2290 | [`dnsPromises.lookup()`]: dns.md#dnspromiseslookuphostname-options | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -705,13 +705,6 @@ A special type of error that can be triggered whenever Node.js detects an | |||
| 705 | 705 | exceptional logic violation that should never occur. These are raised typically | |
| 706 | 706 | by the `node:assert` module. | |
| 707 | 707 | ||
| 708 | - <a id="ERR_ASSERT_SNAPSHOT_NOT_SUPPORTED"></a> | ||
| 709 | - | ||
| 710 | - ### `ERR_ASSERT_SNAPSHOT_NOT_SUPPORTED` | ||
| 711 | - | ||
| 712 | - An attempt was made to use `assert.snapshot()` in an environment that | ||
| 713 | - does not support snapshots, such as the REPL, or when using `node --eval`. | ||
| 714 | - | ||
| 715 | 708 | <a id="ERR_ASYNC_CALLBACK"></a> | |
| 716 | 709 | ||
| 717 | 710 | ### `ERR_ASYNC_CALLBACK` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -491,9 +491,6 @@ Track heap object allocations for heap snapshots. | |||
| 491 | 491 | .It Fl -unhandled-rejections=mode | |
| 492 | 492 | Define the behavior for unhandled rejections. Can be one of `strict` (raise an error), `warn` (enforce warnings) or `none` (silence warnings). | |
| 493 | 493 | . | |
| 494 | - .It Fl -update-assert-snapshot | ||
| 495 | - Updates snapshot files used by `assert.snapshot()`. | ||
| 496 | - . | ||
| 497 | 494 | .It Fl -use-bundled-ca , Fl -use-openssl-ca | |
| 498 | 495 | Use bundled Mozilla CA store as supplied by current Node.js version or use OpenSSL's default CA store. | |
| 499 | 496 | The default store is selectable at build-time. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1052,9 +1052,6 @@ assert.doesNotMatch = function doesNotMatch(string, regexp, message) { | |||
| 1052 | 1052 | ||
| 1053 | 1053 | assert.CallTracker = CallTracker; | |
| 1054 | 1054 | ||
| 1055 | - const snapshot = require('internal/assert/snapshot'); | ||
| 1056 | - assert.snapshot = snapshot; | ||
| 1057 | - | ||
| 1058 | 1055 | /** | |
| 1059 | 1056 | * Expose a strict only variant of assert. | |
| 1060 | 1057 | * @param {...any} args | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -962,8 +962,6 @@ module.exports = { | |||
| 962 | 962 | E('ERR_AMBIGUOUS_ARGUMENT', 'The "%s" argument is ambiguous. %s', TypeError); | |
| 963 | 963 | E('ERR_ARG_NOT_ITERABLE', '%s must be iterable', TypeError); | |
| 964 | 964 | E('ERR_ASSERTION', '%s', Error); | |
| 965 | - E('ERR_ASSERT_SNAPSHOT_NOT_SUPPORTED', | ||
| 966 | - 'Snapshot is not supported in this context ', TypeError); | ||
| 967 | 965 | E('ERR_ASYNC_CALLBACK', '%s must be a function', TypeError); | |
| 968 | 966 | E('ERR_ASYNC_TYPE', 'Invalid name for async "type": %s', TypeError); | |
| 969 | 967 | E('ERR_BROTLI_INVALID_PARAM', '%s is not a valid Brotli parameter', RangeError); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -659,11 +659,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { | |||
| 659 | 659 | &EnvironmentOptions::force_repl); | |
| 660 | 660 | AddAlias("-i", "--interactive"); | |
| 661 | 661 | ||
| 662 | - AddOption("--update-assert-snapshot", | ||
| 663 | - "update assert snapshot files", | ||
| 664 | - &EnvironmentOptions::update_assert_snapshot, | ||
| 665 | - kAllowedInEnvironment); | ||
| 666 | - | ||
| 667 | 662 | AddOption("--napi-modules", "", NoOp{}, kAllowedInEnvironment); | |
| 668 | 663 | ||
| 669 | 664 | AddOption("--tls-keylog", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -139,7 +139,6 @@ class EnvironmentOptions : public Options { | |||
| 139 | 139 | bool preserve_symlinks = false; | |
| 140 | 140 | bool preserve_symlinks_main = false; | |
| 141 | 141 | bool prof_process = false; | |
| 142 | - bool update_assert_snapshot = false; | ||
| 143 | 142 | #if HAVE_INSPECTOR | |
| 144 | 143 | std::string cpu_prof_dir; | |
| 145 | 144 | static const uint64_t kDefaultCpuProfInterval = 1000; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments