I have two components, one nested inside the other:
class Example extends React.Component {
render() {
return null;
}
}
class ExampleWrapper extends React.Component {
render() {
return <Example />;
}
}
I'm trying to assert that the outer element results in a null render:
it("is an empty render", () => {
let component = mount(<ExampleWrapper />);
expect(component).toBeEmptyRender();
});
However, this test fails with the following error:'
Expected <ExampleWrapper> to be empty render (false or null), but it was not
Found Nodes HTML output: null
24 | it("is an empty render", () => {
25 | let component = mount(<ExampleWrapper />);
> 26 | expect(component).toBeEmptyRender();
| ^
27 | });
I have two components, one nested inside the other:
I'm trying to assert that the outer element results in a
null
render:However, this test fails with the following error:'