handle cyclic references
orta opened this issue · comments
Orta Therox commented
describe("layout", () => {
it("renders as expected", () => {
const homeComponent = renderer.create(<Home home={homeProps(3, 3, 3).home}/>).toJSON()
expect(homeComponent).toMatchSnapshot()
console.log(homeComponent)
const jsonRep = JSON.stringify(homeComponent)
fs.writeFileSync("home-component.json", jsonRep)
expect(homeComponent).toMatchSVGSnapshot(620, 480)
})
})
Can't even generate JSON:
● layout › renders as expected
TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at Object.it (src/lib/containers/__tests__/file:/Users/orta/dev/projects/artsy/ios/emission/src/lib/containers/__tests__/home-tests.tsx:43:26)