我试图用jest和酶测试一个从异步函数返回的组件,但是我在构建它时遇到了问题

async function action() {
  return {
    chunks: ['something'],
    title: 'something',
    component: (
      <Layout>
        <Something_else />
      </Layout>
    ),
  };
}
export default action;

和我的测试:

import React from 'react';
import {mount} from 'enzyme';
import index from './index.js';
import toJson from 'enzyme-to-json';

it('Snapshot test', () => {
        const i = index();
        i.then((r) => {

            const ccc = React.createClass({
                render() {
                   return r.component;
                   }
             })

             const wrapper = mount(<ccc />);

            expect(toJson(wrapper)).toMatchSnapshot();
        })
        .catch(() => {
            console.log('err');
        });
    });

问题是,在我的快照中,我得到的是一行“ <ccc /> ”,不是_2441959的孩子?