askui
Version:
Reliable, automated end-to-end-testing that depends on what is shown on your screen instead of the technology you are running on
29 lines (28 loc) • 1.28 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createArgsWithDefaults = createArgsWithDefaults;
exports.createCliFlagsFromArgs = createCliFlagsFromArgs;
function createArgsWithDefaults(args) {
const defaults = {
actionDelayInMs: 1000,
binaryVersion: 'latest',
display: 0,
host: '127.0.0.1',
logLevel: 'debug',
minimize: true,
overWriteBinary: false,
port: 6769,
};
return Object.assign(defaults, args);
}
function createCliFlagsFromArgs(args) {
return [
`-d ${args.display.toString()}`,
(args === null || args === void 0 ? void 0 : args.port) ? `-p ${args.port.toString()}` : '',
(args === null || args === void 0 ? void 0 : args.actionDelayInMs) ? `--action_wait_time ${args.actionDelayInMs.toString()}` : '',
(args === null || args === void 0 ? void 0 : args.host) ? `--host ${args.host}` : '',
(args === null || args === void 0 ? void 0 : args.minimize) ? '-m ' : '',
(args === null || args === void 0 ? void 0 : args.logLevel) ? `--log-level ${args.logLevel}` : '',
(args === null || args === void 0 ? void 0 : args.logFilePath) ? `--log-file ${args.logFilePath}` : '',
].filter((arg) => !!arg);
}