📅  最后修改于: 2022-03-11 15:02:36.479000             🧑  作者: Mango
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);
});
});
});