Skip to content

Commit 3aa8649

Browse files
cjihrigRafaelGSS
authored andcommitted
test_runner: finish marking snapshot testing as stable
Snapshot testing was marked stable in #55897. These were overlooked at the time. Refs: #55897 PR-URL: #56425 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Jacob Smith <[email protected]> Reviewed-By: Pietro Marchini <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
1 parent 48ebd53 commit 3aa8649

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

doc/api/test.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,13 @@ test('runs timers as setTime passes ticks', (context) => {
932932

933933
## Snapshot testing
934934

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+
-->
936942

937943
Snapshot tests allow arbitrary values to be serialized into string values and
938944
compared against a set of known good values. The known good values are known as
@@ -1748,8 +1754,6 @@ describe('tests', async () => {
17481754
added: v22.3.0
17491755
-->
17501756

1751-
> Stability: 1.0 - Early development
1752-
17531757
An object whose methods are used to configure default snapshot settings in the
17541758
current process. It is possible to apply the same configuration to all files by
17551759
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
17611765
added: v22.3.0
17621766
-->
17631767

1764-
> Stability: 1.0 - Early development
1765-
17661768
* `serializers` {Array} An array of synchronous functions used as the default
17671769
serializers for snapshot tests.
17681770

@@ -1778,8 +1780,6 @@ more robust serialization mechanism is required, this function should be used.
17781780
added: v22.3.0
17791781
-->
17801782

1781-
> Stability: 1.0 - Early development
1782-
17831783
* `fn` {Function} A function used to compute the location of the snapshot file.
17841784
The function receives the path of the test file as its only argument. If the
17851785
test is not associated with a file (for example in the REPL), the input is
@@ -3259,8 +3259,6 @@ test('test', (t) => {
32593259
added: v22.3.0
32603260
-->
32613261

3262-
> Stability: 1.0 - Early development
3263-
32643262
* `value` {any} A value to serialize to a string. If Node.js was started with
32653263
the [`--test-update-snapshots`][] flag, the serialized value is written to
32663264
the snapshot file. Otherwise, the serialized value is compared to the

lib/internal/test_runner/snapshot.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const {
1515
ERR_INVALID_STATE,
1616
},
1717
} = require('internal/errors');
18-
const { emitExperimentalWarning, kEmptyObject } = require('internal/util');
18+
const { kEmptyObject } = require('internal/util');
1919
let debug = require('internal/util/debuglog').debuglog('test_runner', (fn) => {
2020
debug = fn;
2121
});
@@ -28,7 +28,6 @@ const { strictEqual } = require('assert');
2828
const { mkdirSync, readFileSync, writeFileSync } = require('fs');
2929
const { dirname } = require('path');
3030
const { createContext, runInContext } = require('vm');
31-
const kExperimentalWarning = 'Snapshot testing';
3231
const kMissingSnapshotTip = 'Missing snapshots can be generated by rerunning ' +
3332
'the command with the --test-update-snapshots flag.';
3433
const defaultSerializers = [
@@ -47,13 +46,11 @@ let resolveSnapshotPathFn = defaultResolveSnapshotPath;
4746
let serializerFns = defaultSerializers;
4847

4948
function setResolveSnapshotPath(fn) {
50-
emitExperimentalWarning(kExperimentalWarning);
5149
validateFunction(fn, 'fn');
5250
resolveSnapshotPathFn = fn;
5351
}
5452

5553
function setDefaultSnapshotSerializers(serializers) {
56-
emitExperimentalWarning(kExperimentalWarning);
5754
validateFunctionArray(serializers, 'serializers');
5855
serializerFns = ArrayPrototypeSlice(serializers);
5956
}
@@ -207,7 +204,6 @@ class SnapshotManager {
207204
const manager = this;
208205

209206
return function snapshotAssertion(actual, options = kEmptyObject) {
210-
emitExperimentalWarning(kExperimentalWarning);
211207
validateObject(options, 'options');
212208
const {
213209
serializers = serializerFns,

0 commit comments

Comments
 (0)