-
Notifications
You must be signed in to change notification settings - Fork 987
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
Out of memory when snapshotting react-sortable-hoc #249
Comments
After an afternoon of digging into the same issue, I got lucky and got a partial snapshot before it crashed. It turns out, SortableContainer requires I'm going to spend this evening to see if it's possible to hack up the snapshot serializer to ignore that property in the meantime. |
Hey @cameronmcefee, Thanks for looking into this! From what I gather from previous discussions on this issue, it was also an issue with Jest snapshots not playing well with The reason const contentWindow = this.props.contentWindow || window; |
@clauderic I trust your guidance on this, as I'm just pretending to be a competent developer. Without knowing the considerations of the project that seems reasonable though. If I pass the component a prop of |
If it's of any use from a proof-I'm-not-making-it-up standpoint, here's the first few lines of the snapshot:
You get the idea. |
Yeah that makes a lot of sense. I'll run test case and get back to you with my findings 😄 |
👋 I hate to be the "any update on this?" guy, but this issue is preventing me from writing some acceptance tests I'd love to have. Would it be helpful if I submit a PR for your suggested change above? |
Hey @cameronmcefee, Sorry about the delay, completely forgot to look into this. A PR would be most welcome, especially if you're able to confirm it solves the issue ❤️ |
Jest/Node crashes with a memory leak when trying to snapshot a component that contains an element connected with react-sortable-hoc.
The Jest developers stated that this is not an issue with the snapshotting, but with the library.
It makes it very hard to write proper tests for anything that involves a sortable.
Simple test case:
Jest 20.0.4, Node 8.1.4 on macOS 10.12.5
The actual error (which Google tells me is basically out of memory):
RangeError: Invalid string length
The text was updated successfully, but these errors were encountered: