UNPKG

@serenity-js/core

Version:

The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure

31 lines 1.23 kB
import type { JSONObject } from 'tiny-types'; import { RuntimeError } from './RuntimeError'; /** * Thrown to indicate that the test can't be performed due to an issue with a downstream dependency. * For example, it makes no sense to run a full-stack integration test if we already know that * the database server is down. * * ## Throwing a TestCompromisedError from a custom Interaction * * ```ts * import { Interaction } from '@serenity-js/core'; * * const SetUpTestDatabase = () => * Interaction.where(`#actor sets up a test database`, actor => { * return SomeCustomDatabaseSpecificAbility.as(actor).setUpTestDatabase().catch(error => { * throw new TestCompromisedError('Could not set up the test database', error) * }) * }) * ``` * * @group Errors */ export declare class TestCompromisedError extends RuntimeError { static fromJSON(serialised: JSONObject): TestCompromisedError; /** * @param message - Human-readable description of the error * @param [cause] - The root cause of this [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/), if any */ constructor(message: string, cause?: Error); } //# sourceMappingURL=TestCompromisedError.d.ts.map