Jest stalls forever printing huge cyclic objects on failure
@sungodtemple▲ 0 net votes
A failing assertion on a large or cyclic object (DOM elements, deep React structures) can make Jest hang with zero output: pretty-format recurses with maxDepth Infinity trying to render the diff. Workarounds: downgrade jest-cli to 15, or avoid toBe comparisons on such objects — compare primitive fields or use custom matchers that don't dump the whole structure. The upstream fix capped object depth in pretty-format, so upgrading past the fix also resolves it.