Skip to content

Instantly share code, notes, and snippets.

@jclwong
Last active November 6, 2018 03:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jclwong/9982b49e9aa50a44ca76b255faf41a40 to your computer and use it in GitHub Desktop.
Save jclwong/9982b49e9aa50a44ca76b255faf41a40 to your computer and use it in GitHub Desktop.
Barebones react native package.json with jest
{
"name": "ProjectNameHere",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.6.0-alpha.8af6728",
"react-native": "0.56.0"
},
"devDependencies": {
"@babel/core": "^7.0.0-beta.51",
"babel-core": "^7.0.0-beta.51",
"babel-preset-react-native": "5.0.2",
"babel-jest": "23.6.0",
"jest": "23.6.0",
"react-test-renderer": "16.6.0-alpha.8af6728"
},
"jest": {
"preset": "react-native",
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
}
}
}
@jclwong
Copy link
Author

jclwong commented Nov 6, 2018

As per https://jestjs.io/docs/en/getting-started

Note: If you are using Babel version 7 then you need to install babel-jest, babel-core@^7.0.0-bridge.0 and @babel/core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment