也许你可以帮助我吗?
我想要配置jest来使用babel@7
所以现在有以下内容:
并且获得了 <\p>
但是如果我使用
"jest": "^23.4.1",
"@babel/core": "^7.0.0-beta.54",
"babel-7-jest": "^21.3.3",
"babel-jest": "^20.0.3",
在package.json文件中配置jest
"jest": {
"transform": {
"^.+\\.js$": "babel-7-jest",
},
并且获得了 <\p>
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string
但是如果我使用
"jest": {
"transform": {
"^.+\\.js$": "babel-jest",
},
I got
Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel.
Babel 配置: https://gist.github.com/SilentImp/1506e9c26d16d9839a4469c6f3ae5c4d
你可能有一些想法?