-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snapshot serializer doesn't work with DOMStringMap
and NamedNodeMap
#5233
Comments
I can reproduced the same error, not sure what it is |
I think it's not a bug, because We can hardcode custom serialization for this case, but I'm think it's bad way. It's a JSDOM problem, because browser doesn't have it. May be this jsdom/jsdom#1129 update resolve it. |
We do that for lots of stuff already, including |
@SimenB oh, thx, I find it and can fix this bug. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
I suppose this could be considered a feature request.
What is the current behavior?
Jest throws an error when I try to serialize a
DOMStringMap
orNamedNodeMap
. The output is:RangeError: Invalid string length
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.The test is very simple:
Same behavior for
NamedNodeMap
What is the expected behavior?
Jest should be able to serialize
DOMStringMap
andNamedNodeMap
so I can reduce snapshot output to the values which I am interested in.As a workaround, I spread the values into a new object.
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
[email protected]
[email protected]
[email protected]
The text was updated successfully, but these errors were encountered: