我正在将本机应用程序从0.50升级到0.56。 设法使它生成,但是在本机库中的流类型上运行笑话测试失败。我似乎没有被翻译。我遇到错误:
SyntaxError: /projectRoot/node_modules/react-native/Libraries/Color/normalizeColor.js: Unexpected token, expected "," (14:29)
12 | 'use strict';
13 |
> 14 | function normalizeColor(color: string | number): ?number {
| ^
15 | const matchers = getMatchers();
16 | let match;
17 |
```
我尝试添加
"transformIgnorePatterns": [
"<rootDir>/node_modules/(?!(react-native)/)"
]
但是没有帮助。
这是我的package.json
文件
"devDependencies": {
"@babel/core": "7.0.0-beta.47",
"babel-core": "^7.0.0-0",
"babel-jest": "23.6.0",
"babel-preset-react-native": "5.0.0",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.2",
"eslint": "^2.11.1",
"eslint-config-db": "^1.1.0",
"immutable": "^3.8.2",
"jest": "23.6.0",
"react": "16.4.1",
"react-dom": "^16.0.0",
"react-native": "0.56.0",
"react-native-db-navigation": "^10.0.1",
"react-redux": "^5.0.5",
"react-test-renderer": "^16.0.0-alpha.6",
"redux": "^3.6.0"
},
"jest": {
"preset": "react-native",
"setupTestFrameworkScriptFile": "./test/setup.js",
"transformIgnorePatterns": [
"<rootDir>/node_modules/(?!(react-native)/)"
]
}
有什么办法解决这个问题吗?