我有以下内容:
import {shallow} from "enzyme" const wrapper = shallow(<SampleComponent/>);
如何查看包装器的内容?
您可以使用wrapper.debug()获得表示包装元素的字符串,例如:
import {shallow} from "enzyme"; const wrapper = shallow(<SampleComponent/>); console.log(wrapper.debug());