Skip to main content

BettererReporter.contextStart()

API > @betterer/betterer > BettererReporter > contextStart

The contextStart() hook is called when a BettererContext starts. The lifecycle promise will resolve when the context ends or reject when the context throws an error, so it can be used instead of the BettererReporter.contextEnd() and BettererReporter.contextError() hooks.

Signature

contextStart?(context: BettererContext, lifecycle: Promise<BettererContextSummary>): Promise<void> | void;

Parameters

ParameterTypeDescription
contextBettererContextThe test context.
lifecyclePromise<BettererContextSummary>A promise that resolves when the context ends and rejects when the context throws.

Returns

Promise<void> | void