-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Using mount() causes out-of-memory errors #2405
Comments
enzyme doesn't actually support snapshot tests - the closest would be |
(see #1642) |
@ljharb Thanks for replying. Ya, I guess I wasn't exactly sure where the issue was and since the issue was only with This is the output of
|
it's a particularly large tree, but that's not even that large of debug output. Whatever you're using to generate snapshots is probably the cause of the issue. That said, enzyme does not endorse or recommend snapshot tests, since they're a highly brittle form of test. |
I'm getting the same or similar error. Using shallow and render does generate logable data.
When I use shallow I can use
Code:
[x] enzyme-adapter-16 |
Running an issue where if I use
mount()
in a snapshot test it fails with a Javacript out of memory error[1]. If I increase the memory to >4GB withNODE_OPTIONS=--max-old-space-size=4096
on my test script there is no longer a Javascript out-of-memory issue but instead a "Invalid string length" issue[2] which I'm not sure is related to enzyme. I would like to be able to run tests as needed without having to allocate a quarter of my system's memory to it hahaImportant to note that
render()
andshallow()
both work as expected[1]
[2]
Current behavior
Javascript out-of-memory error when using
mount()
in a snapshot testExpected behavior
Enzyme should probably not be running out of memory especially for such a simple dom
Your environment
Jest: I've tried Jest 24, 25, and 26
enzyme-to-json: I've tried 3.4.4 and 3.5.0
Node: I tried lts/dubnium & lts/erbium
Ubuntu 16.04 LTS
Also reproduced on MacOS Catalina
API
Version
Adapter
The text was updated successfully, but these errors were encountered: