mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-17 07:39:17 +08:00
Remove unused jest-react-native leftovers
Reviewed By: cpojer Differential Revision: D4212163 fbshipit-source-id: 61d86d03ea817088b378c21d16a35104bc33920b
This commit is contained in:
committed by
Facebook Github Bot
parent
0ec0b9df8e
commit
c8a5b42b45
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
throw new Error(
|
||||
'React-Native and Jest should be tested together with the jest-react-native preset:' +
|
||||
'http://facebook.github.io/jest/docs/tutorial-react-native.html'
|
||||
);
|
||||
@@ -32,7 +32,7 @@ function init(projectDir, argsOrName) {
|
||||
: [argsOrName].concat(process.argv.slice(4)); // argsOrName was e.g. 'AwesomeApp'
|
||||
|
||||
// args array is e.g. ['AwesomeApp', '--verbose']
|
||||
if (!args || args.lentgh == 0) {
|
||||
if (!args || args.length === 0) {
|
||||
console.error('react-native init requires a project name.');
|
||||
return;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ function generateProject(destinationRoot, newProjectName, options) {
|
||||
}
|
||||
|
||||
const yarnVersion =
|
||||
(!options['npm']) &&
|
||||
(!options.npm) &&
|
||||
yarn.getYarnVersionIfAvailable() &&
|
||||
yarn.isGlobalCliUsingYarn(destinationRoot);
|
||||
|
||||
@@ -81,7 +81,9 @@ function generateProject(destinationRoot, newProjectName, options) {
|
||||
execSync(`npm install react@${reactVersion} --save --save-exact`);
|
||||
}
|
||||
if (!options['skip-jest']) {
|
||||
const jestDeps = `jest babel-jest jest-react-native babel-preset-react-native react-test-renderer@${reactVersion}`;
|
||||
const jestDeps = (
|
||||
`jest babel-jest babel-preset-react-native react-test-renderer@${reactVersion}`
|
||||
);
|
||||
if (yarnVersion) {
|
||||
console.log('Adding Jest...');
|
||||
execSync(`yarn add ${jestDeps} --dev --exact`);
|
||||
|
||||
Reference in New Issue
Block a user