Skip to content

Commit

Permalink
[ftr] accept the project name as an unnamed arg
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed May 17, 2017
1 parent 47e2928 commit b2ac4c2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/functional_test_runner/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import { createToolingLog } from '../utils';
import { createFunctionalTestRunner } from './functional_test_runner';

const cmd = new Command('node scripts/functional_test_runner');

const resolveConfigPath = v => resolve(process.cwd(), v);
const defaultConfigPath = resolveConfigPath('test/functional/config.js');

cmd
.option('--config [path]', 'Path to a config file', resolveConfigPath, defaultConfigPath)
.usage('[options] [project]')
.option('--config [path]', 'Path to a config file', resolveConfigPath)
.option('--bail', 'stop tests after the first failure', false)
.option('--grep <pattern>', 'pattern used to select which tests to run')
.option('--verbose', 'Log everything', false)
Expand All @@ -21,10 +20,8 @@ cmd
.parse(process.argv);

if (!cmd.config) {
console.log('');
console.log(' --config is a required parameter');
console.log('');
process.exit(1);
const [project = 'functional'] = cmd.args;
cmd.config = resolveConfigPath(`test/${project}/config.js`);
}

let logLevel = 'info';
Expand Down

0 comments on commit b2ac4c2

Please sign in to comment.