You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/config/index.md
+8-1
Original file line number
Diff line number
Diff line change
@@ -1662,9 +1662,16 @@ Format options for snapshot testing. These options are passed down to [`pretty-f
1662
1662
::: tip
1663
1663
Beware that `plugins` field on this object will be ignored.
1664
1664
1665
-
If you need to extend snapshot serializer via pretty-format plugins, please, use [`expect.addSnapshotSerializer`](/api/expect#expect-addsnapshotserializer) API.
1665
+
If you need to extend snapshot serializer via pretty-format plugins, please, use [`expect.addSnapshotSerializer`](/api/expect#expect-addsnapshotserializer) API or [snapshotSerializers](#snapshotserializers-1-3-0) option.
A list of paths to snapshot serializer modules for snapshot testing, useful if you want add custom snapshot serializers. See [Custom Serializer](/guide/snapshot#custom-serializer) for more information.
Copy file name to clipboardexpand all lines: docs/guide/snapshot.md
+34-1
Original file line number
Diff line number
Diff line change
@@ -117,7 +117,7 @@ You can learn more in the [`examples/image-snapshot`](https://github.com/vitest-
117
117
118
118
You can add your own logic to alter how your snapshots are serialized. Like Jest, Vitest has default serializers for built-in JavaScript types, HTML elements, ImmutableJS and for React elements.
119
119
120
-
Example serializer module:
120
+
You can explicitly add custom serializer by using [`expect.addSnapshotSerializer`](/api/expect#expect-addsnapshotserializer) API.
0 commit comments