Askr documentation
Generated API snapshot

@askrjs/server/testing

Exports from the declarations published in @askrjs/server. Signatures reflect the published artifact.

Exports

This entrypoint publishes 6 exports. Use the anchored symbol rows for direct links. Type-only exports are labeled separately from runtime values.

AdapterConformanceErrortype

AdapterConformanceError: typeof AdapterConformanceError

A failed adapter-conformance guarantee with a stable machine-readable {@link code}.

code
readonly code: AdapterConformanceErrorCode;
name
readonly name = "AdapterConformanceError";

AdapterConformanceErrorCodetype

AdapterConformanceErrorCode: "STREAM_EXERCISE_FAILED" | "STREAM_EXERCISE_TIMEOUT" | "STREAM_CANCELLATION_TIMEOUT" | "REQUEST_TIMEOUT_EXERCISE_FAILED" | "REQUEST_TIMEOUT_ENFORCEMENT_TIMEOUT"

Stable diagnostic codes produced by {@link runAdapterConformance}.

AdapterConformanceExercisestype

AdapterConformanceExercises: any

Real-transport exercises supplied by an adapter's integration test.

abortStreamingResponse
Write the supplied infinite response through the real adapter, observe a client chunk, then close/reset the client. Resolve after the transport disconnect is observed.
enforceRequestTimeout
Run the supplied body-reading app through the real adapter with finite request/header timeouts, send an incomplete request, and resolve after the transport terminates it.

AdapterConformanceOptionstype

AdapterConformanceOptions: any

Options for {@link runAdapterConformance}.

deadlineMs
Per-exercise deadline in milliseconds. Defaults to 1,000.

AdapterConformanceReporttype

AdapterConformanceReport: any

Frozen success result returned by {@link runAdapterConformance}.

streamingResponseCancellation
readonly streamingResponseCancellation: "passed";
incompleteRequestTimeout
readonly incompleteRequestTimeout: "passed";

runAdapterConformancetype

runAdapterConformance: (exercises: AdapterConformanceExercises, options?: AdapterConformanceOptions) => Promise<Readonly<AdapterConformanceReport>>

Runs reusable adapter guardrails against real-transport exercises supplied by the adapter. Validation errors throw synchronously; runtime failures reject with {@link AdapterConformanceError}. Exercise callbacks must honor the cleanup signal and close any sockets/servers they own.