ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
Cearte a file mock.js on rootDir
place this inside. file
jest.useFakeTimers()
now under setup
"setupFiles": [
"./node_modules/react-native-gesture-handler/jestSetup.js",
"<rootDir>/mock.js" //place here
],
================This is my file====================
"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",
"<rootDir>/mock.js"
],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
},