-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Description
it('renders nothing', () => {
const RenderNull = React.createClass({
render: () => null
})
expect(<RenderNull/>, 'to have rendered', null)
})The error message you get:
expected <RenderNull /> to have rendered null
No matching assertion, did you mean:
<ReactElement> to have [exactly] rendered <ReactElement>
<ReactElement> to have rendered [with all children] [with all wrappers] <ReactElement>
<ReactShallowRenderer> to have [exactly] rendered <ReactElement>
<ReactShallowRenderer> to have rendered [with all children] [with all wrappers] <ReactElement>
<RenderedReactElement> to have [exactly] rendered <ReactElement>
<RenderedReactElement> to have rendered [with all children] [with all wrappers] <ReactElement>
It would be nice to support the following:
expect(<RenderNull />, 'to have rendered', null)and
expect(<RenderNull />, 'to have rendered nothing')hkjorgensen, joelmukuthu and dominicrj23