我在从create-react-app在 Windows 8.1 上创建的干净安装的应用程序运行 Jest 时遇到问题。安装后,运行命令npm run test,我收到错误:
No tests found related to files changed since last commit.
Running jest --watchAll,因此绕过 react-scripts,在同一目录中,虽然,显示:
Test suite failed to run
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: …Run Code Online (Sandbox Code Playgroud)