Reactjs 测试';ReactHtmlPasser';用笑话和酶

Reactjs 测试';ReactHtmlPasser';用笑话和酶,reactjs,jestjs,enzyme,Reactjs,Jestjs,Enzyme,我想在react to test‘ReactHtmlParser’中使用Jest和Enzyme编写单元测试用例 import ReactHtmlParser from 'react-html-parser'; renderData = () =>{ const posts = this.props.data; return posts.map((post,index)=>{ return <div key={po

我想在react to test‘ReactHtmlParser’中使用Jest和Enzyme编写单元测试用例

import ReactHtmlParser from 'react-html-parser';

    renderData = () =>{
        const posts = this.props.data;
        return posts.map((post,index)=>{
            return <div key={post._id} className="L1-Video-Warpper">
                <div className="comp-132-video-title">{post.title}</div>
                        {
                            ReactHtmlParser(post.fileURL)
                        }
                    </div>
        })
    }
从'react html parser'导入ReactHtmlParser';
renderData=()=>{
const posts=this.props.data;
返回posts.map((post,index)=>{
返回
{post.title}
{
ReactHtmlPasser(post.fileURL)
}
})
}

你能提供一个完整的、最少的代码吗?您使用什么包来实现
ReactHtmlParser
函数?模拟它。断言它是用正确的参数调用的。你能提供一个完整的、最少的代码吗?您使用什么包来实现
ReactHtmlParser
函数?模拟它。断言它是用正确的参数调用的。