Skip to main content

externalTestCompromisedError

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

externalconstructor

  • Parameters

    • externalmessage: string

      Human-readable description of the error

    • externaloptionalcause: Error

      The root cause of this RuntimeError, if any

    Returns TestCompromisedError

Properties

publicexternaloptionalreadonlycause

cause?: Error

The root cause of this RuntimeError, if any

externalname

name: string

externalmessage

message: string

externaloptionalstack

stack?: string

Methods

staticexternalfromJSON

externaltoString

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


    Returns string

externaltoJSON

  • toJSON(): object
  • Returns object