Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a more sophisticated template for end-to-end testing. #1187

Merged
merged 22 commits into from
Jan 23, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Hide --internal-testing-template (former --template) CLI option
  • Loading branch information
EnoahNetzach committed Jan 18, 2017
commit bc9edfa7cd7a10a0147f6536371a7fe8499490a3
12 changes: 9 additions & 3 deletions packages/create-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ if (currentNodeVersion.split('.')[0] < 4) {
process.exit(1);
}

var commander = require('commander');
var fs = require('fs-extra');
var path = require('path');
var execSync = require('child_process').execSync;
Expand All @@ -60,7 +61,7 @@ var semver = require('semver');

var projectName;

var program = require('commander')
var program = commander
.version(require('./package.json').version)
.arguments('<project-directory>')
.usage(chalk.green('<project-directory>') + ' [options]')
Expand All @@ -69,7 +70,7 @@ var program = require('commander')
})
.option('--verbose', 'print additional logs')
.option('--scripts-version <alternative-package>', 'use a non-standard version of react-scripts')
.option('--template <path-to-template>', 'use a non-standard application template')
.allowUnknownOption()
.on('--help', function () {
console.log(' Only ' + chalk.green('<project-directory>') + ' is required.');
console.log();
Expand All @@ -96,7 +97,12 @@ if (typeof projectName === 'undefined') {
process.exit(1);
}

createApp(projectName, program.verbose, program.scriptsVersion, program.template);
var hiddenProgram = new commander.Command()
.option('--internal-testing-template <path-to-template>', '(internal usage only, DO NOT RELY ON THIS) ' +
'use a non-standard application template')
.parse(process.argv)

createApp(projectName, program.verbose, program.scriptsVersion, hiddenProgram.internalTestingTemplate);

function createApp(name, verbose, version, template) {
var root = path.resolve(name);
Expand Down
2 changes: 1 addition & 1 deletion tasks/e2e-kitchensink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ npm install $cli_path

# Install the app in a temporary location
cd $temp_app_path
create_react_app --scripts-version=$scripts_path --template=$root_path/packages/react-scripts/fixtures/kitchensink test-kitchensink
create_react_app --scripts-version=$scripts_path --internal-testing-template=$root_path/packages/react-scripts/fixtures/kitchensink test-kitchensink

# ******************************************************************************
# Now that we used create-react-app to create an app depending on react-scripts,
Expand Down