Jest/Enzyme ShallowWrapper is empty when creating Snapshot

前端 未结 8 900
醉话见心
醉话见心 2020-12-28 15:25

So I\'m writing a test for my Item component and I tried to render the ItemCard component and then use that wrapper to create a snapshot but it returns an empty

8条回答
  •  执笔经年
    2020-12-28 16:01

    You can just use mount and debug function like this :

    it('Should render Component', () => {
        const wrapper = mount();
        expect(wrapper.debug()).toMatchSnapshot();
      });
    

提交回复
热议问题