我有以下内容:
import {shallow} from "enzyme"
const wrapper = shallow(<SampleComponent/>);
&#13;
如何查看包装器的内容?
答案 0 :(得分:7)
您可以使用wrapper.debug()来获取表示包装元素的字符串,如:
0001100001
答案 1 :(得分:4)
import {shallow} from "enzyme";
const wrapper = shallow(<SampleComponent/>);
console.log(wrapper.html());