Skip to content

failFast only reports the first failure #244

@zainab-ali

Description

@zainab-ali

failFast only reports the first failure in a group of expectations. It is defined as follows:

  def failFast[F[_]: Sync]: F[Unit] =
    this.run match {
      case Invalid(e) => Sync[F].raiseError(e.head)
      case Valid(_)   => Sync[F].unit
    }

To support multiple failures, we could define a new datatype for raising composite exceptions. For example:

case class ExpectationsFailed(failures: NonEmptyList[ExpectationFailed]) extends Throwable

This could be matched against when constructing a Result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions