当尝试运行测试时,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)