Skip to main content

TestCompromisedError

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

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)
})
})

Hierarchy

Index

Constructors

constructor

  • Parameters

    • message: string

      Human-readable description of the error

    • optionalcause: Error

      The root cause of this RuntimeError, if any

    Returns TestCompromisedError

Properties

externalname

name: string

externalmessage

message: string

externaloptionalstack

stack?: string

publicoptionalreadonlycause

cause?: Error

The root cause of this RuntimeError, if any

Methods

staticfromJSON

toString

  • toString(): string
  • Human-readable description of the error


    Returns string

toJSON

  • toJSON(): object
  • Returns object