Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ test('runs timers as setTime passes ticks', (context) => {
## Snapshot testing

<!-- YAML
added: v22.3.0
added: v20.16.0
changes:
- version: v23.4.0
pr-url: https://github.com/nodejs/node/pull/55897
Expand Down Expand Up @@ -1915,7 +1915,7 @@ assertion already exists with the same name, it is overwritten.
## `snapshot`

<!-- YAML
added: v22.3.0
added: v20.16.0
-->

An object whose methods are used to configure default snapshot settings in the
Expand All @@ -1926,7 +1926,7 @@ placing common configuration code in a module preloaded with `--require` or
### `snapshot.setDefaultSnapshotSerializers(serializers)`

<!-- YAML
added: v22.3.0
added: v20.16.0
-->

* `serializers` {Array} An array of synchronous functions used as the default
Expand All @@ -1941,7 +1941,7 @@ more robust serialization mechanism is required, this function should be used.
### `snapshot.setResolveSnapshotPath(fn)`

<!-- YAML
added: v22.3.0
added: v20.16.0
-->

* `fn` {Function} A function used to compute the location of the snapshot file.
Expand Down Expand Up @@ -3602,7 +3602,7 @@ highlighting.
#### `context.assert.snapshot(value[, options])`

<!-- YAML
added: v22.3.0
added: v20.16.0
-->

* `value` {any} A value to serialize to a string. If Node.js was started with
Expand Down Expand Up @@ -3667,7 +3667,7 @@ the path of the root test file.
### `context.fullName`

<!-- YAML
added: v22.3.0
added: v20.16.0
-->

The name of the test and each of its ancestors, separated by `>`.
Expand Down Expand Up @@ -3970,6 +3970,14 @@ The absolute path of the test file that created the current suite. If a test
file imports additional modules that generate suites, the imported suites will
return the path of the root test file.

### `context.fullName`

<!-- YAML
added: v20.16.0
-->

The name of the suite and each of its ancestors, separated by `>`.

### `context.name`

<!-- YAML
Expand Down