BettererContext
API > @betterer/betterer > BettererContext
The context of a set of test suite runs.
Signature
export interface BettererContext
Remarks
The internal implementation of BettererContext
is responsible for a lot more than this interface suggests, but we want to minimise the public API surface as much as possible. You can get the BettererContext
via the BettererReporter
interface.
Example
const myReporter: BettererReporter = {
// Access the context before any tests are run:
contextStart (context: BettererContext) {
// ...
},
// Access the context when something goes wrong:
contextError (context: BettererContext) {
// ...
}
}
Properties
Property | Type | Description |
---|---|---|
config | BettererConfig | The config of the context. You probably don't want to mess with this directly 🔥. If you need to update the config, you should use BettererContext.options() instead. |
Methods
Method | Description |
---|---|
options(optionsOverride) | Make changes to the context config. The updated config will be used for the next run. |
stop() | Stop the test run and clean everything up. If tests are running, waits for them to end before stopping. |