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