UNPKG

ticket2test

Version:

Pull JIRA ticket information and create a JS test file

48 lines (43 loc) 1.14 kB
const { ArgumentParser } = require("argparse"); const packageInfo = require("../package.json"); const argparser = new ArgumentParser({ description: "Ticket2Test Test Template Generator", version: packageInfo.version, addHelp: true }); const subparsers = argparser.addSubparsers({ dest: "command" }); let commands = subparsers.addParser("config"); commands.addArgument("--server", { type: "string", nargs: 1, help: "server address for your ticket tracker (e.g. myjiraname.atlassian.net)" }); commands.addArgument("--username", { type: "string", nargs: 1, help: "username for the ticket server" }); commands.addArgument("--password", { type: "string", nargs: 1, help: "password for the provided username" }); commands.addArgument("--template", { type: "string", nargs: 1, help: "path to test template file" }); commands.addArgument("--outputDir", { type: "string", nargs: 1, help: "path to output test files" }); commands = subparsers.addParser("createById"); commands.addArgument("--id", { type: "string", nargs: 1, help: "The Jira Ticket ID (e.g. XYZ-123)" }); module.exports = argparser;