Реагируйте на собственное приложение expo с настройкой шут-тестов снимков - PullRequest
0 голосов
/ 30 января 2019

Я не мог заставить Jest-тестирование снимков работать в приложении React.Я получаю все виды ошибок в зависимости от набора узловых модулей и конфигурации.
Примеры:
* SyntaxError: Unexpected identifier import ... или около import React из другого файла,
* jest encountered an unexpected token import,
*Ошибки, связанные с script_transformer.

Вот мой package.json

{
  "name": "empty-project-template",
  "main": "node_modules/expo/AppEntry.js",
  "private": true,
  "scripts": {
    "lint": "eslint .",
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject",
    "test": "node_modules/.bin/jest"
  },
  "dependencies": {
    "expo": "^31.0.0",
    "moment": "^2.22.2",
    "pouchdb-react-native": "^6.4.1",
    "prop-types": "^15.6.2",
    "react": "16.3.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz",
    "react-native-easy-toast": "^1.1.0",
    "react-native-range-datepicker": "^1.8.2",
    "react-navigation": "^2.18.2",
    "react-redux": "^5.1.1",
    "redux": "^4.0.1",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "babel-eslint": "^10.0.1",
    "babel-plugin-syntax-class-properties": "^6.13.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "eslint": "^5.9.0",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-react": "^7.11.1",
    "jest-expo": "^31.0.0",
    "react-test-renderer": "^16.7.0"
  },
  "jest": {
    "preset": "jest-expo",
    "transformIgnorePatterns": [
      "node_modules/(?!(pouchdb-react-native|pouchdb-adapter-asyncstorage))"
    ]
  }
}

Может кто-нибудь указать мне на рабочий репозиторий React-native Expo с тестами моментальных снимков Jest.

...