Skip to main content

Class: Variation

Extends

  • BenchmarkBase

Constructors

new Variation()

new Variation(name): Variation

Parameters

name: string

Returns

Variation

Overrides

BenchmarkBase.constructor

Defined in

src/variation.ts:14

Properties

action?

optional action: Action

Inherited from

BenchmarkBase.action

Defined in

src/shared-api.ts:13


cliArgs

cliArgs: string[] = []

Defined in

src/variation.ts:12


environment

environment: Partial<ProcessEnv> = {}

Defined in

src/variation.ts:11


errorStrategy?

optional errorStrategy: ErrorStrategy

Inherited from

BenchmarkBase.errorStrategy

Defined in

src/shared-api.ts:14


name

name: string

Defined in

src/variation.ts:14


setupEachMethods

setupEachMethods: SetupMethod[] = []

Inherited from

BenchmarkBase.setupEachMethods

Defined in

src/shared-api.ts:9


setupMethods

setupMethods: SetupMethod[] = []

Inherited from

BenchmarkBase.setupMethods

Defined in

src/shared-api.ts:10


teardownEachMethods

teardownEachMethods: TeardownMethod[] = []

Inherited from

BenchmarkBase.teardownEachMethods

Defined in

src/shared-api.ts:12


teardownMethods

teardownMethods: TeardownMethod[] = []

Inherited from

BenchmarkBase.teardownMethods

Defined in

src/shared-api.ts:11

Methods

withAction()

withAction(action): this

Parameters

action: Action

Returns

this

Inherited from

BenchmarkBase.withAction

Defined in

src/shared-api.ts:36


withCliArgs()

withCliArgs(...args): this

Parameters

• ...args: string[]

Returns

this

Defined in

src/variation.ts:85


withEnvironmentVariable()

withEnvironmentVariable(name, value): this

Parameters

name: string

value: string

Returns

this

Defined in

src/variation.ts:80


withEnvironmentVariables()

withEnvironmentVariables(env): this

Parameters

env: Partial<ProcessEnv>

Returns

this

Defined in

src/variation.ts:72


withErrorStrategy()

withErrorStrategy(errorStrategy): this

Parameters

errorStrategy: ErrorStrategy

Returns

this

Inherited from

BenchmarkBase.withErrorStrategy

Defined in

src/shared-api.ts:41


withSetup()

withSetup(setup): this

Parameters

setup: SetupMethod

Returns

this

Inherited from

BenchmarkBase.withSetup

Defined in

src/shared-api.ts:16


withSetupEach()

withSetupEach(setup): this

Parameters

setup: SetupMethod

Returns

this

Inherited from

BenchmarkBase.withSetupEach

Defined in

src/shared-api.ts:21


withTeardown()

withTeardown(teardown): this

Parameters

teardown: TeardownMethod

Returns

this

Inherited from

BenchmarkBase.withTeardown

Defined in

src/shared-api.ts:26


withTeardownEach()

withTeardownEach(teardown): this

Parameters

teardown: TeardownMethod

Returns

this

Inherited from

BenchmarkBase.withTeardownEach

Defined in

src/shared-api.ts:31


FromCliArgs()

static FromCliArgs(args): Variation[]

Parameters

args: (string | string[])[]

An array of options to pass to the CLI. If an element is an array, they will be treated as alternatives.

Returns

Variation[]

An array of variations. Can be applied with withVariations.

Example

// Creates 2 variations, both with --flag, but one with --no-daemon and the other with --daemon.
const variations = Variation.FromCliArgs([
'--flag',
['--no-daemon', '--daemon'],
]);

// Creates 4 variations, with combinations of --a and --b.
const variations = Variation.FromCliArgs([
['--a', '--b'],
]);

Defined in

src/variation.ts:59


FromEnvironmentVariables()

static FromEnvironmentVariables(variables): Variation[]

Parameters

variables: EnvironmentVariableOptions

Returns

Variation[]

Defined in

src/variation.ts:18