Ошибка типа: не удается прочитать свойство 'PlatformLocalStorage' из неопределенного - PullRequest
0 голосов
/ 29 апреля 2020

Я запускаю шутный тест наact-native и получаю следующие ошибки

Не удалось запустить набор тестов

TypeError: Cannot read property 'PlatformLocalStorage' of undefined

  2 | import thunk from 'redux-thunk';
  3 | import { persistStore, persistReducer } from 'redux-persist';
> 4 | import AsyncStorage from '@react-native-community/async-storage';
    | ^
  5 | 
"dependencies":{
    "react": "16.8.3",
    "react-native": "0.59.9",
},
"devDependencies": {
  "jest": "^24.1.0",
  "enzyme": "^3.9.0",
    "enzyme-adapter-react-16": "^1.10.0",
},

  "jest": {
    "setupFilesAfterEnv": [
      "<rootDir>/__tests__/setup/test-setup.js"
    ],
    "setupFiles": [
      "<rootDir>/__tests__/setup/test-setup.js"
    ],
    "transformIgnorePatterns": [
      "/node_modules(?![\\/]rn-fetch-blob[\\/]|[\\/]react-native[\\/]|[\\/]react-native-config[\\/]|[\\/]react-native-navigation[\\/]|[\\/]react-native-status-bar-height[\\/]|[\\/]react-native-animatable[\\/]|[\\/]react-native-restart[\\/]|[\\/]react-native-linear-gradient[\\/]|[\\/]react-native-i18n[\\/]|[\\/]react-native-modal[\\/]|[\\/]react-native-smooth-pincode-input[\\/]|[\\/]react-native-swipe-gestures[\\/]|[\\/]react-native-root-toast[\\/]|[\\/]react-native-root-siblings[\\/]|[\\/]static-container[\\/]|[\\/]react-native-elements[\\/]|[\\/]react-native-ratings[\\/]|[\\/]react-native-progress[\\/]|[\\/]react-native-dialog[\\/]|[\\/]react-native-pdf[\\/]|[\\/]react-native-webview[\\/]|[\\/]react-native-check-box[\\/]|[\\/]react-native-share[\\/]|[\\/]react-native-haptic-feedback[\\/]|[\\/]react-native-responsive-screen[\\/]|[\\/]react-native-keyboard-aware-scroll-view[\\/]|[\\/]he[\\/]|[\\/]react-native-iphone-x-helper[\\/]|[\\/]check-prop-types[\\/]|[\\/]react-native-image-progress[\\/]|[\\/]react-native-theming[\\/]|[\\/]@react-native-community/async-storage[\\/])/"
    ],
    "testPathIgnorePatterns": [
      "<rootDir>/(build|docs|node_modules)/",
      "<rootDir>/__tests__/setup"
    ],
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "fonts"
    ]
  }
}

Может кто-нибудь, пожалуйста помогите мне, почему появляются эти ошибки, когда я запускаю шут-тест в приложении-родном приложении. я обновил несколько зависимостей dev, но не повезло.

...