Skip to main content Link Search Menu Expand Document (external link)

ActionSummaryTest overview

Test utilities for ActionSummary service.

Provides a mock layer factory for testing actions that use ActionSummary.

Example

import { ActionSummary, ActionSummaryTest } from "@effect-native/platform-github"
import { Effect } from "effect"

const test = ActionSummaryTest.make()
const program = Effect.gen(function* () {
  const summary = yield* ActionSummary.ActionSummary
  summary.addHeading("Title").addRaw("Content")
  return test.getBuffer()
}).pipe(Effect.provide(test.layer))
// Effect.runSync(program) // => "<h1>Title</h1>Content"

Added in v1.0.0


Table of contents


constructors

make

Creates a test layer for ActionSummary with the given options.

Signature

export declare const make: (options?: TestOptions) => TestContext

Added in v1.0.0

layers

layer

A default test layer.

Signature

export declare const layer: Layer.Layer<ActionSummary, never, never>

Added in v1.0.0

models

TestContext (interface)

Result of creating a test ActionSummary layer, including the layer and a function to inspect the buffer.

Signature

export interface TestContext {
  readonly layer: Layer.Layer<ActionSummary>
  readonly getBuffer: () => string
}

Added in v1.0.0

TestOptions (interface)

Options for creating a test ActionSummary layer.

Signature

export interface TestOptions {
  readonly writeError?: Error
  readonly clearError?: Error
}

Added in v1.0.0