React native React本机升级-jest TransformIgnore模式不再工作?

React native React本机升级-jest TransformIgnore模式不再工作?,react-native,babeljs,React Native,Babeljs,我最近升级到RN 0.56.0。我的应用程序运行得很好,但当我运行测试时,我收到的错误告诉我,我的第三方模块不是以普通javascript发布的,但即使在将transformIgnorePatterns应用到相关模块后,babel似乎也无法正常工作 Test suite failed to run SyntaxError: /Users/cobb/develop/my-app/node_modules/react-navigation-props-mapper/index.js: Un

我最近升级到RN 0.56.0。我的应用程序运行得很好,但当我运行测试时,我收到的错误告诉我,我的第三方模块不是以普通javascript发布的,但即使在将
transformIgnorePatterns
应用到相关模块后,babel似乎也无法正常工作

Test suite failed to run

    SyntaxError: /Users/cobb/develop/my-app/node_modules/react-navigation-props-mapper/index.js: Unexpected token (10:13)

       8 | 
       9 |     if (!SecondOrderWrapperComponent) {
    > 10 |       return <WrappedComponent {...screenProps} {...propsExceptScreenProps} {...params} />;
         |              ^
      11 |     } else {
      12 |       return (
      13 |         <SecondOrderWrapperComponent

      at Parser.raise (node_modules/@babel/parser/lib/index.js:3898:15)
      at Parser.unexpected (node_modules/@babel/parser/lib/index.js:5227:16)
      at Parser.parseExprAtom (node_modules/@babel/parser/lib/index.js:6307:20)
      at Parser.parseExprSubscripts (node_modules/@babel/parser/lib/index.js:5903:21)
      at Parser.parseMaybeUnary (node_modules/@babel/parser/lib/index.js:5882:21)
      at Parser.parseExprOps (node_modules/@babel/parser/lib/index.js:5791:21)
      at Parser.parseMaybeConditional (node_modules/@babel/parser/lib/index.js:5763:21)
      at Parser.parseMaybeAssign (node_modules/@babel/parser/lib/index.js:5710:21)
      at Parser.parseExpression (node_modules/@babel/parser/lib/index.js:5663:21)
      at Parser.parseReturnStatement (node_modules/@babel/parser/lib/index.js:7476:28)
和package.json:

{
  "name": "pensive-app",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "@babel/core": "^7.0.0-beta.55",
    "babel-core": "^7.0.0-0",
    "babel-eslint": "^8.2.2",
    "babel-jest": "^23.4.2",
    "babel-preset-react-native": "^5.0.1",
    "eslint": "^4.18.2",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-import": "^2.9.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-react": "^7.7.0",
    "jest": "^22.4.2",
    "jest-fetch-mock": "^1.4.2",
    "jest-react-native": "^18.0.0",
    "patch-package": "^5.1.1",
    "postinstall-postinstall": "^1.0.0",
    "react-test-renderer": "16.2.0"
  },
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "test": "node node_modules/jest/bin/jest.js",
    "eslint": "./node_modules/.bin/eslint App.js src/**/*.js",
    "postinstall": "patch-package"
  },
  "jest": {
    "preset": "react-native",
    "setupFiles": [
      "./setupJest.js"
    ],
    "collectCoverageFrom": [
      "src/**/*.{js,jsx}",
      "!**/node_modules/**",
      "!**/vendor/**"
    ],
    "transformIgnorePatterns": [
      "node_modules/(?!react-navigation-props-mapper)/"
    ]
  },
  "dependencies": {
    "amazon-cognito-identity-js": "^2.0.19",
    "aws-amplify": "^1.0.4",
    "aws-sdk": "^2.282.1",
    "password-validator": "^4.1.1",
    "prop-types": "^15.6.1",
    "react": "16.4.1",
    "react-native": "0.56.0",
    "react-native-keyboard-aware-scroll-view": "^0.4.4",
    "react-native-loading-spinner-overlay": "^0.5.2",
    "react-native-phone-input": "^0.2.1",
    "react-native-swipeout": "^2.3.3",
    "react-native-tag-select": "^2.0.0",
    "react-native-vector-icons": "^4.6.0",
    "react-navigation": "1.5.11",
    "react-navigation-props-mapper": "^0.2.0",
    "react-redux": "^5.0.7",
    "redux": "^3.7.2"
  }
}
如果我正确地阅读了这个错误,那么jest似乎在尝试做一些事情,但失败了,这说明我的.babelrc中可能存在一些错误配置。我可以看到有相当多的变化,在这个新的巴别塔,这仍然是'测试版'。也许我应该坚持RN 0.55一段时间

{
  "name": "pensive-app",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "@babel/core": "^7.0.0-beta.55",
    "babel-core": "^7.0.0-0",
    "babel-eslint": "^8.2.2",
    "babel-jest": "^23.4.2",
    "babel-preset-react-native": "^5.0.1",
    "eslint": "^4.18.2",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-plugin-import": "^2.9.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-react": "^7.7.0",
    "jest": "^22.4.2",
    "jest-fetch-mock": "^1.4.2",
    "jest-react-native": "^18.0.0",
    "patch-package": "^5.1.1",
    "postinstall-postinstall": "^1.0.0",
    "react-test-renderer": "16.2.0"
  },
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "test": "node node_modules/jest/bin/jest.js",
    "eslint": "./node_modules/.bin/eslint App.js src/**/*.js",
    "postinstall": "patch-package"
  },
  "jest": {
    "preset": "react-native",
    "setupFiles": [
      "./setupJest.js"
    ],
    "collectCoverageFrom": [
      "src/**/*.{js,jsx}",
      "!**/node_modules/**",
      "!**/vendor/**"
    ],
    "transformIgnorePatterns": [
      "node_modules/(?!react-navigation-props-mapper)/"
    ]
  },
  "dependencies": {
    "amazon-cognito-identity-js": "^2.0.19",
    "aws-amplify": "^1.0.4",
    "aws-sdk": "^2.282.1",
    "password-validator": "^4.1.1",
    "prop-types": "^15.6.1",
    "react": "16.4.1",
    "react-native": "0.56.0",
    "react-native-keyboard-aware-scroll-view": "^0.4.4",
    "react-native-loading-spinner-overlay": "^0.5.2",
    "react-native-phone-input": "^0.2.1",
    "react-native-swipeout": "^2.3.3",
    "react-native-tag-select": "^2.0.0",
    "react-native-vector-icons": "^4.6.0",
    "react-navigation": "1.5.11",
    "react-navigation-props-mapper": "^0.2.0",
    "react-redux": "^5.0.7",
    "redux": "^3.7.2"
  }
}