UNPKG

cypress-load-balancer

Version:

A simple load balancer for Cypress tests.

44 lines (43 loc) 1.69 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = __importDefault(require("../../utils")); exports.default = { command: "initialize", description: "Initializes the load balancing map file and directory.", //@ts-expect-error Need to fix type builder: function (yargs) { return (yargs // .option("output", { // alias: "o", // description: "An output file path to which to save. If not provided, uses the original file path", // type: "string", // default: utils.MAIN_LOAD_BALANCING_MAP_FILE_PATH // }) .option("force", { description: "Forces re-initialization of file even if existing", type: "boolean", default: false }) .option("force-dir", { description: "Forces re-initialization of directory even if existing", type: "boolean", default: false })); }, //@ts-expect-error Need to fix type handler: function (argv) { const [isDirectoryCreated, isFileCreated] = utils_1.default.initializeLoadBalancingFiles({ forceCreateMainDirectory: argv["force-dir"], forceCreateMainLoadBalancingMap: argv["force"] }); if (isDirectoryCreated) { console.log("cypress-load-balancer", "Created directory"); } if (isFileCreated) { console.log("cypress-load-balancer", "Created initial file"); } } };