@johnf/react-native-owl
Version:
Visual regression testing for React Native
55 lines (54 loc) • 1.58 kB
JavaScript
;
var _yargs = _interopRequireDefault(require("yargs"));
var _helpers = require("yargs/helpers");
var _build = require("./build.js");
var _run = require("./run.js");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const argv = (0, _yargs.default)((0, _helpers.hideBin)(process.argv));
const plaformOption = {
alias: 'p',
describe: 'Platform to build and run the app',
demandOption: true,
choices: ['ios', 'android']
};
const configOption = {
alias: 'c',
describe: 'Configuration file to be used',
type: 'string',
default: './owl.config.json'
};
const updateOption = {
alias: 'u',
describe: 'Update the baseline screenshots',
type: 'boolean',
default: false
};
const testPathPatternOption = {
alias: 't',
describe: 'Run Test for a matching path pattern',
type: 'string',
default: ''
};
const builderOptionsRun = {
config: configOption,
platform: plaformOption
};
const builderOptionsTest = {
config: configOption,
platform: plaformOption,
update: updateOption,
testPathPattern: testPathPatternOption
};
argv.usage('Usage: $0 <command> [options]').command({
command: 'build',
describe: 'Build the React Native project',
builder: builderOptionsRun,
handler: _build.buildHandler
}).command({
command: 'test',
describe: 'Runs the test suite',
builder: builderOptionsTest,
handler: _run.runHandler
}).help('help').alias('h', 'help').showHelpOnFail(false, 'Specify --help for available options').alias('v', 'version').argv;
//# sourceMappingURL=index.js.map