小编Vol*_*lha的帖子

如何在 NX 项目中使用 es6 将 jest 与 node_modules 一起使用

我有一个具有 NX 结构的项目(应用程序 + 库)。我正在为 React + TypeScript 库编写测试。当我尝试使用 suneditor + suneditor-react 时遇到了这个问题:

\n
Jest encountered an unexpected token\n\n    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.\n\n    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.\n\n    By default "node_modules" folder is ignored by transformers.\n\n    Here's …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs jestjs babel-jest nrwl-nx

7
推荐指数
1
解决办法
4239
查看次数

标签 统计

babel-jest ×1

javascript ×1

jestjs ×1

nrwl-nx ×1

reactjs ×1