我已经多次问过这个问题,但我遇到的所有解决方案似乎都不适合我.我在尝试为Vue应用程序运行Jest测试时遇到以下错误.
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:
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your …Run Code Online (Sandbox Code Playgroud)