Skip to content

Commit

Permalink
add config flag to cli
Browse files Browse the repository at this point in the history
  • Loading branch information
rpivo committed Nov 4, 2021
1 parent f30092d commit 57782a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint": "npx prettier --write .",
"pack": "npm pack",
"prepublishOnly": "npm run build",
"rap": "cd example && npx rap --page=http://localhost:3000/three-buttons --watch"
"rap": "cd example && npx rap -c react.automation.yml --page=http://localhost:3000/three-buttons"
},
"dependencies": {
"browser-sync": "^2.27.4",
Expand Down
11 changes: 7 additions & 4 deletions src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { MessageTypes, printMessage } from './util.js';
interface Options {
averageOf: number;
changeInterval: number;
config: string;
includeMount: boolean;
page: string;
port: number;
Expand All @@ -25,10 +26,6 @@ const { AUTOMATION_START, AUTOMATION_STOP, ERROR } = MessageTypes;
`);

const options = yargs
.usage(
`Usage: --averageOf <averageOf> --changeInterval <changeInterval> \
--includeMount <includeMount> --page <page> --port <port> --watch <watch>`
)
.option('averageOf', {
describe: 'run each flow n number of times and average out the metrics',
type: 'number',
Expand All @@ -37,6 +34,11 @@ const { AUTOMATION_START, AUTOMATION_STOP, ERROR } = MessageTypes;
describe: 'number of changes before automation is rerun',
type: 'number',
})
.option('config', {
alias: 'c',
describe: 'configuration file',
type: 'string',
})
.option('includeMount', {
describe: 'includes the initial mount render',
type: 'boolean',
Expand All @@ -57,6 +59,7 @@ const { AUTOMATION_START, AUTOMATION_STOP, ERROR } = MessageTypes;

const {
averageOf = 1,
config = '',
changeInterval = 1,
includeMount = false,
page,
Expand Down

0 comments on commit 57782a9

Please sign in to comment.