Skip to content

TestAnnotations

6 exports Added in v2.0.0 Source

Other

Signature

declare function isTestAnnotations(u: unknown): u is TestAnnotations;

make

Added in v2.0.0 Source

Signature

declare function make(ref: Ref<TestAnnotationMap>): TestAnnotations;

Signature

declare const TestAnnotations: Tag<TestAnnotations, TestAnnotations>;

TestAnnotations interface

Added in v2.0.0 Source

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.

Signature

interface TestAnnotations {
  readonly [TestAnnotationsTypeId]: typeof TestAnnotationsTypeId;
  readonly ref: Ref<TestAnnotationMap>;
  readonly supervisedFibers: Effect<SortedSet<RuntimeFiber<unknown, unknown>>>;
  annotate<A>(key: TestAnnotation<A>, value: A): Effect<void>;
  get<A>(key: TestAnnotation<A>): Effect<A>;
}

Signature

declare const TestAnnotationsTypeId: unique symbol;

Signature

type TestAnnotationsTypeId = typeof TestAnnotationsTypeId;