Skip to content

does this work with react-test-renderer AND react-addons-test-utils ? #6

@faceyspacey

Description

@faceyspacey

I.e. does it work with the component tree's meant for serialization/snapshots:

import renderer from 'react-test-renderer'
import { querySelectorAll } from 'bill'

const tree = renderer.create(<div />).toJSON()
const matches = querySelectorAll('div', tree)
import ReactTestUtils from 'react-addons-test-utils'
import { querySelectorAll } from 'bill'

const renderer = ReactTestUtils.createRenderer()
renderer.render(<div />)

const tree = renderer.getRenderOutput()
const matches = querySelectorAll('div', tree)

The reason I ask is because you may have already created a component instance with renderer.create() which continues to stay reactively "alive" responding to state changes, and then you want to traverse its component tree, not the original component tree you first passed to renderer.create().

I'd like to add *Bill` to this library of mine:

https://github.com/faceyspacey/jest-redux-snap

So, for example, will bill be able to work with renderer.create(<div />).toJSON()?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions