UNPKG

k6-node

Version:

CLI tool that enables k6 installation via npm packages

24 lines (23 loc) 793 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createK6LoadTest = createK6LoadTest; const k6_builder_1 = require("../builders/k6-builder"); /** * Create a simple load test with stages for k6 * In k6, load tests typically use ramping VUs to simulate realistic traffic patterns * * @param config - Configuration object with stages, steps, and thresholds * @returns Configured K6TestBuilder instance */ function createK6LoadTest(config) { const builder = new k6_builder_1.K6TestBuilder(); if (config.imports) { builder.addImports(...config.imports); } builder.setOptions({ stages: config.stages, thresholds: config.thresholds, }); builder.createScenario('load_test', config.steps); return builder; }