UNPKG

@gatling.io/core

Version:

Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).

29 lines (28 loc) 1.21 kB
export interface GetWithDefault { (name: string): string | undefined; (name: string, defaultValue: string): string; } /** * Gets the parameter indicated by the specified name. * * Parameters can be specified in the `gatling run` command by passing arguments with the format `key=value`, e.g. * `gatling run parameter1=foo parameter2=bar`. You would then retrieve them in your simulation by calling * `getParameter("parameter1")` and `getParameter("parameter2")`. * * @param key - the key of the parameter. * @param defaultValue - a default value * @returns the string value of the parameter if it is defined, or else `defaultValue` if provided, or else `undefined`. */ export declare const getParameter: GetWithDefault; /** * @deprecated Use {@link getParameter} instead. */ export declare const getOption: GetWithDefault; /** * Gets the environment variable indicated by the specified name. * * @param name - the name of the environment variable. * @param defaultValue - a default value * @returns the string value of the environment variable if it is defined, or else `defaultValue` if provided, or else `undefined`. */ export declare const getEnvironmentVariable: GetWithDefault;