| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 48ebd53 commit 3aa8649
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -932,7 +932,13 @@ test('runs timers as setTime passes ticks', (context) => { | |||
| 932 | 932 | ||
| 933 | 933 | ## Snapshot testing | |
| 934 | 934 | ||
| 935 | - > Stability: 1.0 - Early development | ||
| 935 | + <!-- YAML | ||
| 936 | + added: v22.3.0 | ||
| 937 | + changes: | ||
| 938 | + - version: v23.4.0 | ||
| 939 | + pr-url: https://github.com/nodejs/node/pull/55897 | ||
| 940 | + description: Snapsnot testing is no longer experimental. | ||
| 941 | + --> | ||
| 936 | 942 | ||
| 937 | 943 | Snapshot tests allow arbitrary values to be serialized into string values and | |
| 938 | 944 | compared against a set of known good values. The known good values are known as | |
@@ -1748,8 +1754,6 @@ describe('tests', async () => { | |||
| 1748 | 1754 | added: v22.3.0 | |
| 1749 | 1755 | --> | |
| 1750 | 1756 | ||
| 1751 | - > Stability: 1.0 - Early development | ||
| 1752 | - | ||
| 1753 | 1757 | An object whose methods are used to configure default snapshot settings in the | |
| 1754 | 1758 | current process. It is possible to apply the same configuration to all files by | |
| 1755 | 1759 | placing common configuration code in a module preloaded with `--require` or | |
@@ -1761,8 +1765,6 @@ placing common configuration code in a module preloaded with `--require` or | |||
| 1761 | 1765 | added: v22.3.0 | |
| 1762 | 1766 | --> | |
| 1763 | 1767 | ||
| 1764 | - > Stability: 1.0 - Early development | ||
| 1765 | - | ||
| 1766 | 1768 | * `serializers` {Array} An array of synchronous functions used as the default | |
| 1767 | 1769 | serializers for snapshot tests. | |
| 1768 | 1770 | ||
@@ -1778,8 +1780,6 @@ more robust serialization mechanism is required, this function should be used. | |||
| 1778 | 1780 | added: v22.3.0 | |
| 1779 | 1781 | --> | |
| 1780 | 1782 | ||
| 1781 | - > Stability: 1.0 - Early development | ||
| 1782 | - | ||
| 1783 | 1783 | * `fn` {Function} A function used to compute the location of the snapshot file. | |
| 1784 | 1784 | The function receives the path of the test file as its only argument. If the | |
| 1785 | 1785 | test is not associated with a file (for example in the REPL), the input is | |
@@ -3259,8 +3259,6 @@ test('test', (t) => { | |||
| 3259 | 3259 | added: v22.3.0 | |
| 3260 | 3260 | --> | |
| 3261 | 3261 | ||
| 3262 | - > Stability: 1.0 - Early development | ||
| 3263 | - | ||
| 3264 | 3262 | * `value` {any} A value to serialize to a string. If Node.js was started with | |
| 3265 | 3263 | the [`--test-update-snapshots`][] flag, the serialized value is written to | |
| 3266 | 3264 | the snapshot file. Otherwise, the serialized value is compared to the | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ const { | |||
| 15 | 15 | ERR_INVALID_STATE, | |
| 16 | 16 | }, | |
| 17 | 17 | } = require('internal/errors'); | |
| 18 | - const { emitExperimentalWarning, kEmptyObject } = require('internal/util'); | ||
| 18 | + const { kEmptyObject } = require('internal/util'); | ||
| 19 | 19 | let debug = require('internal/util/debuglog').debuglog('test_runner', (fn) => { | |
| 20 | 20 | debug = fn; | |
| 21 | 21 | }); | |
@@ -28,7 +28,6 @@ const { strictEqual } = require('assert'); | |||
| 28 | 28 | const { mkdirSync, readFileSync, writeFileSync } = require('fs'); | |
| 29 | 29 | const { dirname } = require('path'); | |
| 30 | 30 | const { createContext, runInContext } = require('vm'); | |
| 31 | - const kExperimentalWarning = 'Snapshot testing'; | ||
| 32 | 31 | const kMissingSnapshotTip = 'Missing snapshots can be generated by rerunning ' + | |
| 33 | 32 | 'the command with the --test-update-snapshots flag.'; | |
| 34 | 33 | const defaultSerializers = [ | |
@@ -47,13 +46,11 @@ let resolveSnapshotPathFn = defaultResolveSnapshotPath; | |||
| 47 | 46 | let serializerFns = defaultSerializers; | |
| 48 | 47 | ||
| 49 | 48 | function setResolveSnapshotPath(fn) { | |
| 50 | - emitExperimentalWarning(kExperimentalWarning); | ||
| 51 | 49 | validateFunction(fn, 'fn'); | |
| 52 | 50 | resolveSnapshotPathFn = fn; | |
| 53 | 51 | } | |
| 54 | 52 | ||
| 55 | 53 | function setDefaultSnapshotSerializers(serializers) { | |
| 56 | - emitExperimentalWarning(kExperimentalWarning); | ||
| 57 | 54 | validateFunctionArray(serializers, 'serializers'); | |
| 58 | 55 | serializerFns = ArrayPrototypeSlice(serializers); | |
| 59 | 56 | } | |
@@ -207,7 +204,6 @@ class SnapshotManager { | |||
| 207 | 204 | const manager = this; | |
| 208 | 205 | ||
| 209 | 206 | return function snapshotAssertion(actual, options = kEmptyObject) { | |
| 210 | - emitExperimentalWarning(kExperimentalWarning); | ||
| 211 | 207 | validateObject(options, 'options'); | |
| 212 | 208 | const { | |
| 213 | 209 | serializers = serializerFns, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments