react-native/local-cli/init/init.js
function addJestToPackageJson(destinationRoot) {
  var packageJSONPath = path.join(destinationRoot, 'package.json');
  var packageJSON = JSON.parse(fs.readFileSync(packageJSONPath));

  packageJSON.scripts.test = 'jest';
  packageJSON.jest = {
    preset: 'react-native'
  };
  fs.writeFileSync(packageJSONPath, JSON.stringify(packageJSON, null, '\t'));
}
function addJestToPackageJson(destinationRoot) {
  var packageJSONPath = path.join(destinationRoot, 'package.json');
  var packageJSON = JSON.parse(fs.readFileSync(packageJSONPath));

  packageJSON.scripts.test = 'jest';
  packageJSON.jest = {
    preset: 'react-native'
  };
  fs.writeFileSync(packageJSONPath, JSON.stringify(packageJSON, null, '\t'));
}
function addJestToPackageJson ( destinationRoot ) { var packageJSONPath = path . join ( destinationRoot , 'package.json' ) ; var packageJSON = JSON . parse ( fs . readFileSync ( packageJSONPath ) ) ; packageJSON . scripts . test = 'jest' ; packageJSON . jest = { preset : 'react-native' } ; fs . writeFileSync ( packageJSONPath , JSON . stringify ( packageJSON , null , '\t' ) ) ; }
Add Jest-related stuff to package.json, which was created by the react-native-cli.
Add Jest - related stuff to package . json which was created by the react - native - cli .