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
I expect to see the custom serializer used when displaying the diffs between the expected and received values in the second test case (test('fails, thereby demonstrating the problem', ...)). In this case it should probably look like this:
- Expected - 2
+ Received + 2
new SomeClass(
- "zorch",
- "florp")
+ "foo",
+ "bar")
Actual behavior
The custom serializer is ignored. The salient part of the reported error looks like this, which is unfortunately not very helpful:
Expected: {}
Received: serializes to the same string
Additional context
I tried adding the custom serializer both via the config file (snapshotSerializers) and using expect.addSnapshotSerializer() in the test file. Neither seems to work.
The first test in example.test.js is there to demonstrate that the serializer is indeed hooked up.
In case it's useful, here's the example tarball in base64-encoded form:
Version
29.7.0
Steps to reproduce
npm install
npm test
Expected behavior
I expect to see the custom serializer used when displaying the diffs between the expected and received values in the second test case (
test('fails, thereby demonstrating the problem', ...)
). In this case it should probably look like this:Actual behavior
The custom serializer is ignored. The salient part of the reported error looks like this, which is unfortunately not very helpful:
Additional context
I tried adding the custom serializer both via the config file (
snapshotSerializers
) and usingexpect.addSnapshotSerializer()
in the test file. Neither seems to work.The first test in
example.test.js
is there to demonstrate that the serializer is indeed hooked up.In case it's useful, here's the example tarball in base64-encoded form:
Environment
System: OS: macOS 14.7.1 CPU: (8) arm64 Apple M1 Binaries: Node: 23.2.0 - /opt/homebrew/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 10.9.0 - /opt/homebrew/bin/npm npmPackages: jest: ^29.7.0 => 29.7.0
The text was updated successfully, but these errors were encountered: