Answers for "type ErrorHandler = (error: mixed, isFatal: boolean) => void; ^^^^^^^^^^^^ SyntaxError: Unexpected identifier"

0

type ErrorHandler = (error: mixed, isFatal: boolean) => void; ^^^^^^^^^^^^ SyntaxError: Unexpected identifier

transformIgnorePatterns: [
-  'node_modules/(?!(jest-)?react-native|@react-native-community|@react-navigation)',
+  'node_modules/(?!(jest-)?@?react-native|@react-native-community|@react-navigation)',
]
this is happen  in the the lastest jest lib 

in your package.json the configuration
like givent above 

remove the line -  in unser jest config 

add  the line +  in this array object 

this is my configuraion


"jest": {
    "preset": "react-native",
    "setupFilesAfterEnv": [
      "@testing-library/jest-native/extend-expect"
    ],
    "transformIgnorePatterns": [
     "node_modules/(?!(jest-)?@?react-native|@reactw-native-community|@react-navigation)"
    ],
    "setupFiles": [
      "./node_modules/react-native-gesture-handler/jestSetup.js"
    ],
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx",
      "json",
      "node"
    ]
},
Posted by: Guest on August-04-2021

Code answers related to "type ErrorHandler = (error: mixed, isFatal: boolean) => void; ^^^^^^^^^^^^ SyntaxError: Unexpected identifier"

Browse Popular Code Answers by Language