问题描述
将含纱的笑话从23.6更新为24.1。 获取SyntaxError:意外的标识符导入
我尝试更新我认为可能相关的每个节点模块。
- "@babel/core": "^7.0.0",
- "@babel/polyfill": "^7.0.0",
+ "@babel/core": "^7.2.2",
+ "@babel/polyfill": "^7.2.5",
"@types/bluebird": "^3.5.24",
@@ -138,8 +138,7 @@
"@types/react-dom": "^16.0.9",
"@types/react-transition-group": "^2.0.14",
"axios-mock-adapter": "^1.15.0",
- "babel-core": "^7.0.0-bridge.0",
- "babel-jest": "^23.6.0",
+ "babel-jest": "^24.1.0",
"babel-merge": "^2.0.1",
"babel-plugin-angularjs-annotate": "^0.9.0",
"babel-plugin-dual-import": "^1.2.1",
@@ -152,7 +151,7 @@
"expect": "^1.20.2",
"fake-indexeddb": "^2.0.3",
"haml": "~0.4.3",
- "jest": "^23.6.0",
+ "jest": "^24.1.0",
"jest-junit": "^5.1.0",
"jest-styled-components": "6.3.1",
"mini-css-extract-plugin": "^0.4.0",
@@ -166,8 +165,8 @@
"stylelint-processor-styled-components": "^1.3.2",
"synchronous-promise": "^2.0.6",
"thread-loader": "^1.1.5",
- "ts-jest": "^23.10.4",
- "typescript": "^3.1.3",
+ "ts-jest": "^23.10.5",
+ "typescript": "^3.3.3",
应该像以前一样进行yarn test
。
1楼
更新:
问题出在jest.config.js中,我们在内部模块之后声明了node_modules:
'moduleDirectories': ['our_modules', 'node_modules']
在新版本中,它不再起作用。