我在安装了jest和transform-decorators-legacy后得到了这个。 但是jest正在成功运行并为每个屏幕传递测试。
bablerc文件:
{
"presets": ["react-native","babel-preset-expo","react-native-
stage-0/decorator-support"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source","transform-decorators
-legacy"]
}
}
}
package.json
"scripts": {
"test": "node_modules/.bin/jest"
},
"jest": {
"preset": "jest-expo"
},
"author": null,
"private": true,
"main": "node_modules/expo/AppEntry.js",
"dependencies": {
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-react-native": "^4.0.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"expo": "^21.0.0",
"mobx": "^3.3.1",
"mobx-react": "^4.3.3",
"native-base": "^2.3.3",
"react": "16.0.0-alpha.12",
"react-native": "https://github.com/expo/react-native/archive/sdk-21.0.2.tar.gz",
"react-native-admob": "^2.0.0-beta.2",
"react-native-keyboard-aware-scroll-view": "^0.4.1",
"react-native-modal": "^4.1.0",
"react-native-prompt": "^1.0.0",
"react-navigation": "^1.0.0-beta.15"
},
"devDependencies": {
"babel-jest": "^21.2.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-react-native": "^4.0.0",
"cavy": "^0.4.1",
"jest": "^21.2.1",
"jest-expo": "^22.0.1-SNAPSHOT.2017.11.1",
"react-dom": "^16.0.0",
"react-test-renderer": "^16.0.0",
"regenerator-runtime": "^0.11.0"
}
}