📌  相关文章
📜  TS2307:找不到模块'. archive.svg' jest react - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:36.479000             🧑  作者: Mango

代码示例2
import React from 'react';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';

// @ts-ignore (works with .tsx)
import Astronaut from '../Astronaut.tsx';

describe(' component', () => {
  describe('should render', () => {
    const wrapper = shallow();
    it ('should render a component matching the snapshot', () => {
      const tree = toJson(wrapper);
      expect(tree).toMatchSnapshot();
      expect(wrapper).toHaveLength(1);
    });
  });
});