最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Mustache template with Jest - Stack Overflow

programmeradmin1浏览0评论

I am currently testing document printing on client side with jest (so test env is js-dom). And I stumbled upon error with lambda that is passed to template. Heres the example of my code:

    const data = {
        ...someFields,
        someField: () => (text, render) => functionThatParsesText(render(text)),
    };

And jest throws error:

TypeError: render is not a function

Is it because Jest tries to call for a function in this code? If thats so, how can it be prevented?

发布评论

评论列表(0)

  1. 暂无评论