ActionRunnerTest overview
Test utilities for ActionRunner service.
Provides a mock layer factory for testing actions that use ActionRunner.
Example
import { ActionRunner, ActionRunnerTest } from "@effect-native/platform-github"
import { Effect } from "effect"
const test = ActionRunnerTest.make({ inputs: { name: "world" } })
const program = ActionRunner.getInput("name").pipe(Effect.provide(test.layer))
// Effect.runPromise(program) // => "world"
Added in v1.0.0
Table of contents
constructors
make
Creates a test layer for ActionRunner with the given options.
Signature
export declare const make: (options?: TestOptions) => TestContext
Added in v1.0.0
layers
layer
Creates a simple test layer with default options.
Signature
export declare const layer: Layer.Layer<ActionRunner, never, never>
Added in v1.0.0
models
TestContext (interface)
Result of creating a test ActionRunner layer, including the layer and mutable stores for inspecting outputs, logs, etc.
Signature
export interface TestContext {
readonly layer: Layer.Layer<ActionRunner>
readonly outputs: Record<string, unknown>
readonly logs: Array<{ level: string; message: string }>
readonly groups: Array<string>
readonly secrets: Array<string>
readonly state: Record<string, string>
readonly env: Record<string, string>
readonly paths: Array<string>
readonly getFailed: () => { message: string } | null
}
Added in v1.0.0
TestOptions (interface)
Options for creating a test ActionRunner layer.
Signature
export interface TestOptions {
readonly inputs?: Record<string, string>
readonly state?: Record<string, string>
}
Added in v1.0.0