@gatling.io/cli
Version:
Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).
40 lines (39 loc) • 1.77 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const options_1 = require("./options");
const simulations_1 = require("../simulations");
const bundle_1 = require("../bundle");
const dependencies_1 = require("../dependencies");
exports.default = (program) => {
program
.command("build")
.description("Build Gatling simulations")
.addOption(options_1.sourcesFolderOption)
.addOption(options_1.protoFolderOption)
.addOption(options_1.bundleFileOption)
.addOption(options_1.protoTargetFolderOption)
.addOption(options_1.postmanOption)
.addOption(options_1.typescriptOption)
.addOption(options_1.gatlingHomeOption)
.action(async (options) => {
const sourcesFolder = (0, options_1.sourcesFolderOptionValue)(options);
const protoFolder = (0, options_1.protoFolderOptionValue)(options);
const bundleFile = (0, options_1.bundleFileOptionValue)(options);
const protoTargetFolder = (0, options_1.protoTargetFolderOptionValue)(options);
const gatlingHome = (0, options_1.gatlingHomeOptionValueWithDefaults)(options);
const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
const postman = (0, options_1.postmanOptionValueWithDefaults)(options);
const typescript = (0, options_1.typescriptOptionValueWithDefaults)(options, simulations);
const { protocPath } = await (0, dependencies_1.resolveBundle)({ gatlingHome });
await (0, bundle_1.bundle)({
sourcesFolder,
protoFolder,
bundleFile,
protoTargetFolder,
postman,
typescript,
simulations,
protocPath
});
});
};