I have the following :
import {shallow} from "enzyme"
const wrapper = shallow(<SampleComponent/>);
how do I see the contents of wrapper?
You can use wrapper.debug() to get a string representing the wrapper element, like in:
import {shallow} from "enzyme";
const wrapper = shallow(<SampleComponent/>);
console.log(wrapper.debug());
import {shallow} from "enzyme";
const wrapper = shallow(<SampleComponent/>);
console.log(wrapper.html());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With