小编Doe*_*Joe的帖子

未转译节点模块的玩笑错误

当尝试运行测试时,Jest 会抛出遇到的意外令牌错误。我正在使用 ky http,这显然会导致问题并且不会被转译。

\n\n
 Test suite failed to run\n\n    Jest encountered an unexpected token\n\n    This usually means that you are trying to import a file which Jest cannot parse, e.g. it\'s not plain JavaScript.\n\n    By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".\n\n    Here\'s what you can do:\n     \xe2\x80\xa2 To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.\n     \xe2\x80\xa2 If you need …
Run Code Online (Sandbox Code Playgroud)

reactjs jestjs babeljs create-react-app unexpected-token

5
推荐指数
1
解决办法
2378
查看次数