Skip to content

conformance/Fixture

What a provider gives the conformance suites: how to make the provider, and what the suites cannot assume of every platform.

Since v0.1.0

What a provider’s tests give run: how to make the provider, and what the suites cannot assume of every platform.

Details

R is what making the provider needs, which layer provides, and E what the fixture’s effects fail with.

Signature

export interface Fixture<R, E> {
/**
* Provides what the fixture's effects need, and the HTTP client the network suite reaches ports
* with.
*/
readonly layer: Layer.Layer<R | HttpClient.HttpClient, E>
/** Makes the provider under test, for one test. */
readonly makeProvider: Effect.Effect<SandboxProvider.SandboxProvider["Service"], E, R | Scope.Scope>
/** A port to create a sandbox with, on which nothing in that sandbox listens yet. */
readonly freePort: Effect.Effect<Network.Port, E, R>
/**
* A command that serves HTTP on `port`, where the sandbox's endpoint for the port reaches it,
* answering each request with its headers as a JSON object, under their names in lowercase.
*/
readonly serveHeaders: (port: Network.Port) => ChildProcess.Command
/** How many milliseconds a test may take, more than the default for a provider on the network. */
readonly timeout?: number
}

Source

Since v0.1.0