首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何运行ui测试?

如何运行ui测试?
EN

Stack Overflow用户
提问于 2020-04-14 20:00:35
回答 1查看 41关注 0票数 1

当我开始测试应用程序时,我得到了一个错误:

代码语言:javascript
复制
    Jest encountered an unexpected token

    This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

    By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

    Here's what you can do:

..。

代码语言:javascript
复制
    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/en/configuration.html

    Details:

    /home/mmvs/Desktop/ReactNative/node_modules/react-navigation/src/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export * from '@react-navigation/core';

如何解决这个错误?

EN

回答 1

Stack Overflow用户

发布于 2020-04-14 20:16:33

您需要在package.json中添加moduleNameMapper,请查看此链接:https://jestjs.io/docs/en/webpack#handling-static-assets

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61207163

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档