import {MochaAdapter} from '@serenity-js/mocha/lib/adapter'
public class | source

MochaAdapter

Allows for programmatic execution of Mocha test scenarios, using SerenityReporterForMocha to report progress.

Constructor Summary

Public Constructor
public

test

Method Summary

Public Methods
public

async load(pathsToScenarios: string[]): Promise<void>

Loads test scenarios.

public

run(): Promise<void>

Runs loaded test scenarios.

public

scenarioCount(): number

Returns the number of loaded scenarios

public

successThreshold(): Outcome | { Code: number }

Scenario success threshold for this test runner.

Public Constructors

public constructor(config: MochaConfig, loader: ModuleLoader) source

test

Params:

NameTypeAttributeDescription
config MochaConfig
loader ModuleLoader

Public Methods

public async load(pathsToScenarios: string[]): Promise<void> source

Loads test scenarios.

Params:

NameTypeAttributeDescription
pathsToScenarios string[]

Returns:

Promise<void>

public run(): Promise<void> source

Runs loaded test scenarios.

Returns:

Promise<void>

Throws:

LogicError

If called before load

public scenarioCount(): number source

Returns the number of loaded scenarios

Returns:

number

Throws:

LogicError

If called before load

public successThreshold(): Outcome | { Code: number } source

Scenario success threshold for this test runner.

Returns:

Outcome | { Code: number }