Annotations

The Annotations trait provides access to an annotation map that tests can add arbitrary annotations to. Each annotation consists of a string identifier, an initial value, and a function for combining two values. Annotations form monoids and you can think of Annotations as a more structured logging service or as a super polymorphic version of the writer monad effect.

class Object
trait Matchable
class Any

Type members

Classlikes

trait Service extends Serializable

Value members

Concrete methods

def annotate[V](key: TestAnnotation[V], value: V): URIO[Annotations, Unit]

Accesses an Annotations instance in the environment and appends the specified annotation to the annotation map.

Accesses an Annotations instance in the environment and appends the specified annotation to the annotation map.

def get[V](key: TestAnnotation[V]): URIO[Annotations, V]

Accesses an Annotations instance in the environment and retrieves the annotation of the specified type, or its default value if there is none.

Accesses an Annotations instance in the environment and retrieves the annotation of the specified type, or its default value if there is none.

def supervisedFibers: ZIO[Annotations, Nothing, SortedSet[Runtime[Any, Any]]]

Returns a set of all fibers in this test.

Returns a set of all fibers in this test.

def withAnnotation[R <: Annotations, E, A](zio: ZIO[R, E, A]): ZIO[R, (E), (A)]

Accesses an Annotations instance in the environment and executes the specified effect with an empty annotation map, returning the annotation map along with the result of execution.

Accesses an Annotations instance in the environment and executes the specified effect with an empty annotation map, returning the annotation map along with the result of execution.

Concrete fields

val live: Layer[Nothing, Annotations]

Constructs a new Annotations service.

Constructs a new Annotations service.