Skip to content

Instantly share code, notes, and snippets.

@janhesters
Created September 16, 2018 18:44
Show Gist options
  • Save janhesters/4bd1dddad28f68d8985bc16249b56aec to your computer and use it in GitHub Desktop.
Save janhesters/4bd1dddad28f68d8985bc16249b56aec to your computer and use it in GitHub Desktop.
Replace the existing `jest` key in the dictionary with this code.
"jest": {
"preset": "react-native",
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js",
"^.+\\.tsx?$": "ts-jest"
},
"globals": {
"ts-jest": {
"tsConfigFile": "tsconfig.jest.json"
}
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"modulePaths": [
"<rootDir>"
],
"setupFiles": [
"./tests/setup.js"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment