📅  最后修改于: 2022-03-11 15:01:25.232000             🧑  作者: Mango
import ShallowRenderer from 'react-test-renderer/shallow';
// in your test:
const renderer = new ShallowRenderer();
renderer.render( );
const result = renderer.getRenderOutput();
expect(result.type).toBe('div');
expect(result.props.children).toEqual([
Title,
]);