@probitas/expect

Type-safe expectation library for Probitas scenario testing with specialized assertions for various client types.

This module provides a unified expect() function that automatically dispatches to the appropriate expectation based on the input type, along with specialized expectations for each client type.

Features

  • Type-safe expectations: Compile-time safety with TypeScript
  • Unified API: Single expect() function that dispatches to specialized expectations
  • Client-specific assertions: Tailored expectations for HTTP, GraphQL, SQL, Redis, MongoDB, and more
  • Method chaining: Fluent API for readable test assertions
  • Consistent naming: All methods follow toBeXxx or toHaveXxx patterns
  • Generic fallback: Chainable wrapper for @std/expect matchers

Usage

Unified expect Function

The expect() function automatically dispatches to the appropriate expectation based on the input type:

Installation

deno add jsr:@probitas/expect

Classes

class

#ConnectRpcError

class ConnectRpcError extends ClientError

Error class for ConnectRPC/gRPC errors.

Use statusCode to distinguish between different gRPC error codes.

NameDescription
name
kind
statusCode
statusMessage
metadata
details
Constructor
new ConnectRpcError(
  message: string,
  statusCode: ConnectRpcStatusCode,
  statusMessage: string,
  options?: ConnectRpcErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"connectrpc"
  • readonlystatusCodeConnectRpcStatusCode
  • readonlystatusMessagestring
  • readonlymetadataHeaders | null
  • readonlydetailsreadonly ErrorDetail[]
class

#ConnectRpcNetworkError

class ConnectRpcNetworkError extends ClientError

Error thrown when a network-level failure occurs.

This error indicates that the request could not be processed by the server due to network issues (connection refused, DNS resolution failure, timeout, etc.). Unlike ConnectRpcError, this error means the server was never reached.

NameDescription
name
kind
Constructor
new ConnectRpcNetworkError(message: string, options?: ErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"connectrpc"
class

#ConstraintError

class ConstraintError extends SqlError
ExtendsSqlError

Error thrown when a constraint violation occurs.

NameDescription
name
kind
constraint
Constructor
new ConstraintError(
  message: string,
  constraint: string,
  options?: SqlErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"constraint"
  • readonlyconstraintstring
class

#DeadlockError

class DeadlockError extends SqlError
ExtendsSqlError

Error thrown when a deadlock is detected.

NameDescription
name
kind
Constructor
new DeadlockError(message: string, options?: SqlErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"deadlock"
class

#DenoKvAtomicBuilderImpl

class DenoKvAtomicBuilderImpl implements DenoKvAtomicBuilder

Implementation of DenoKvAtomicBuilder.

NameDescription
check()
set()
delete()
sum()
min()
max()
commit()
Constructor
new DenoKvAtomicBuilderImpl(kv: Deno.Kv, options?: AtomicBuilderOptions)
Methods
check(): unknown
set(): unknown
delete(): unknown
sum(): unknown
min(): unknown
max(): unknown
commit(): unknown
class

#DenoKvConnectionError

class DenoKvConnectionError extends DenoKvError

Error thrown when a connection to Deno KV fails.

This typically occurs when:

  • Network errors prevent reaching Deno Deploy KV
  • Authentication/authorization fails
  • Service is unavailable
NameDescription
name
kind
Constructor
new DenoKvConnectionError(message: string, options?: ErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"connection"
class

#DenoKvError

class DenoKvError extends ClientError

Base error class for Deno KV operations.

Use the kind property to distinguish between error types:

  • "kv": General KV operation error
  • "quota": Quota limit exceeded
  • "connection": Network/connection failure
NameDescription
name
Constructor
new DenoKvError(message: string, _: unknown, options?: ErrorOptions)
Properties
  • readonlynamestring
class

#ExpectationError

class ExpectationError extends Error
ExtendsError

Custom error class for expectation failures.

This class is used to identify expectation errors and format them differently from regular errors (e.g., without "Error:" prefix in reporters).

Constructor
new ExpectationError(message: string)
class

#GraphqlExecutionError

class GraphqlExecutionError extends ClientError

Error thrown for GraphQL execution errors.

This error is returned when the GraphQL server processes the request but returns errors in the response (validation errors, resolver errors, etc.).

NameDescription
name
kind
errorsGraphQL errors from response
Constructor
new GraphqlExecutionError(
  errors: readonly GraphqlErrorItem[],
  options?: ErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"graphql"
  • readonlyerrorsreadonly GraphqlErrorItem[]

    GraphQL errors from response

class

#GraphqlNetworkError

class GraphqlNetworkError extends ClientError

Error thrown for network-level failures.

This error indicates that the request could not reach or be processed by the GraphQL server (connection refused, HTTP errors, etc.).

NameDescription
name
kind
Constructor
new GraphqlNetworkError(message: string, options?: ErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"network"
class

#HttpError

class HttpError extends ClientError

HTTP error class for non-2xx responses.

This error is thrown (or returned in response.error) when the server responds with a 4xx or 5xx status code. It includes the response body for inspecting error details.

Examples

Check status code and body

import { createHttpClient, HttpError } from "@probitas/client-http";

const http = createHttpClient({ url: "http://localhost:3000", throwOnError: true });
try {
  await http.get("/not-found");
} catch (error) {
  if (error instanceof HttpError && error.status === 404) {
    console.log("Not found:", error.text);
  }
}
NameDescription
name
kind
statusHTTP status code
statusTextHTTP status text
headersResponse headers (null if not available)
body()Response body as raw bytes (null if no body)
arrayBuffer()Get body as ArrayBuffer (null if no body)
blob()Get body as Blob (null if no body)
text()Get body as text (null if no body)
json()Get body as parsed JSON (null if no body).
Constructor
new HttpError(status: number, statusText: string, options?: HttpErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"http"
  • readonlystatusnumber

    HTTP status code

  • readonlystatusTextstring

    HTTP status text

  • readonlyheadersHeaders | null

    Response headers (null if not available)

Methods
body(): unknown

Response body as raw bytes (null if no body)

arrayBuffer(): unknown

Get body as ArrayBuffer (null if no body)

blob(): unknown

Get body as Blob (null if no body)

text(): unknown

Get body as text (null if no body)

json(): unknown

Get body as parsed JSON (null if no body).

class

#HttpNetworkError

class HttpNetworkError extends ClientError

Error thrown when a network-level failure occurs.

This error indicates that the request could not be processed by the server due to network issues (connection refused, DNS resolution failure, etc.).

NameDescription
name
kind
Constructor
new HttpNetworkError(message: string, options?: ErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"network"
class

#MongoConnectionError

class MongoConnectionError extends MongoError
ExtendsMongoError

Error thrown when a MongoDB connection cannot be established.

NameDescription
name
kind
Constructor
new MongoConnectionError(message: string, options?: MongoErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"connection"
class

#MongoDuplicateKeyError

class MongoDuplicateKeyError extends MongoError
ExtendsMongoError

Error thrown when a duplicate key constraint is violated.

NameDescription
name
kind
keyPattern
keyValue
Constructor
new MongoDuplicateKeyError(
  message: string,
  keyPattern: Record<string, number>,
  keyValue: Record<string, unknown>,
  options?: MongoErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"duplicate_key"
  • readonlykeyPatternRecord<string, number>
  • readonlykeyValueRecord<string, unknown>
class

#MongoError

class MongoError extends ClientError

Base error class for MongoDB client errors.

NameDescription
name
code
Constructor
new MongoError(message: string, _: unknown, options?: MongoErrorOptions)
Properties
  • readonlynamestring
  • readonlycode?number
class

#MongoNotFoundError

class MongoNotFoundError extends MongoError
ExtendsMongoError

Error thrown when a document is not found (for firstOrThrow, lastOrThrow).

NameDescription
name
kind
Constructor
new MongoNotFoundError(message: string, options?: MongoErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"not_found"
class

#MongoQueryError

class MongoQueryError extends MongoError
ExtendsMongoError

Error thrown when a MongoDB query fails.

NameDescription
name
kind
collection
Constructor
new MongoQueryError(
  message: string,
  collection: string,
  options?: MongoErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"query"
  • readonlycollectionstring
class

#MongoValidationError

class MongoValidationError extends MongoError
ExtendsMongoError

Error thrown when document validation fails.

NameDescription
name
kind
validationErrors
Constructor
new MongoValidationError(
  message: string,
  validationErrors: readonly string[],
  options?: MongoErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"validation"
  • readonlyvalidationErrorsreadonly string[]
class

#MongoWriteError

class MongoWriteError extends MongoError
ExtendsMongoError

Error thrown when a write operation fails.

NameDescription
name
kind
writeErrors
Constructor
new MongoWriteError(
  message: string,
  writeErrors: readonly { index: number; code: number; message: string }[],
  options?: MongoErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"write"
  • readonlywriteErrorsreadonly { index: number; code: number; message: string }[]
class

#QuerySyntaxError

class QuerySyntaxError extends SqlError
ExtendsSqlError

Error thrown when a SQL query has syntax errors.

NameDescription
name
kind
Constructor
new QuerySyntaxError(message: string, options?: SqlErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"query"
class

#RabbitMqChannelError

class RabbitMqChannelError extends RabbitMqError

Error thrown when a RabbitMQ channel operation fails.

NameDescription
name
kind
channelId
Constructor
new RabbitMqChannelError(message: string, options?: RabbitMqChannelErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"channel"
  • readonlychannelId?number
class

#RabbitMqConnectionError

class RabbitMqConnectionError extends RabbitMqError

Error thrown when a RabbitMQ connection cannot be established.

NameDescription
name
kind
Constructor
new RabbitMqConnectionError(message: string, options?: RabbitMqErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"connection"
class

#RabbitMqError

class RabbitMqError extends ClientError

Base error class for RabbitMQ client errors.

NameDescription
name
code
Constructor
new RabbitMqError(message: string, _: unknown, options?: RabbitMqErrorOptions)
Properties
  • readonlynamestring
  • readonlycode?number
class

#RabbitMqNotFoundError

class RabbitMqNotFoundError extends RabbitMqError

Error thrown when a RabbitMQ resource (queue or exchange) is not found.

NameDescription
name
kind
resource
Constructor
new RabbitMqNotFoundError(
  message: string,
  options: RabbitMqNotFoundErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"not_found"
  • readonlyresourcestring
class

#RabbitMqPreconditionFailedError

class RabbitMqPreconditionFailedError extends RabbitMqError

Error thrown when a RabbitMQ precondition check fails.

NameDescription
name
kind
reason
Constructor
new RabbitMqPreconditionFailedError(
  message: string,
  options: RabbitMqPreconditionFailedErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"precondition_failed"
  • readonlyreasonstring
class

#RedisCommandError

class RedisCommandError extends RedisError
ExtendsRedisError

Error thrown when a Redis command fails.

NameDescription
name
kind
command
Constructor
new RedisCommandError(message: string, options: RedisCommandErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"command"
  • readonlycommandstring
class

#RedisConnectionError

class RedisConnectionError extends RedisError
ExtendsRedisError

Error thrown when a Redis connection cannot be established.

NameDescription
name
kind
Constructor
new RedisConnectionError(message: string, options?: RedisErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"connection"
class

#RedisError

class RedisError extends ClientError

Base error class for Redis client errors.

NameDescription
name
code
Constructor
new RedisError(message: string, _: unknown, options?: RedisErrorOptions)
Properties
  • readonlynamestring
  • readonlycode?string
class

#RedisScriptError

class RedisScriptError extends RedisError
ExtendsRedisError

Error thrown when a Redis Lua script fails.

NameDescription
name
kind
script
Constructor
new RedisScriptError(message: string, options: RedisScriptErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"script"
  • readonlyscriptstring
class

#SqlConnectionError

class SqlConnectionError extends SqlError
ExtendsSqlError

Error thrown when a connection or network-level error occurs.

This includes:

  • Connection refused (server not running)
  • Authentication failure
  • Connection timeout
  • Pool exhaustion
  • TLS handshake failure
  • DNS resolution failure
NameDescription
name
kind
Constructor
new SqlConnectionError(message: string, options?: SqlErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"connection"
class

#SqlError

class SqlError extends ClientError

Base error class for SQL-specific errors. Extends ClientError with SQL-specific properties.

NameDescription
name
kind
sqlState
Constructor
new SqlError(message: string, kind: SqlErrorKind, options?: SqlErrorOptions)
Properties
  • readonlynamestring
  • readonlykindSqlErrorKind
  • readonlysqlStatestring | null
class

#SqsBatchError

class SqsBatchError extends SqsError
ExtendsSqsError

Error thrown when a batch operation partially fails.

NameDescription
name
kind
failedCount
Constructor
new SqsBatchError(
  message: string,
  failedCount: number,
  options?: SqsErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"batch"
  • readonlyfailedCountnumber
class

#SqsCommandError

class SqsCommandError extends SqsError
ExtendsSqsError

Error thrown when an SQS command fails.

NameDescription
name
kind
operation
Constructor
new SqsCommandError(message: string, options: SqsCommandErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"command"
  • readonlyoperationstring
class

#SqsConnectionError

class SqsConnectionError extends SqsError
ExtendsSqsError

Error thrown when an SQS connection cannot be established.

NameDescription
name
kind
Constructor
new SqsConnectionError(message: string, options?: SqsErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"connection"
class

#SqsError

class SqsError extends ClientError

Base error class for SQS client errors.

NameDescription
name
code
Constructor
new SqsError(message: string, _: unknown, options?: SqsErrorOptions)
Properties
  • readonlynamestring
  • readonlycode?string
class

#SqsMessageNotFoundError

class SqsMessageNotFoundError extends SqsError
ExtendsSqsError

Error thrown when a message is not found or receipt handle is invalid.

NameDescription
name
kind
Constructor
new SqsMessageNotFoundError(message: string, options?: SqsErrorOptions)
Properties
  • readonlynamestring
  • readonlykind"message_not_found"
class

#SqsMessageTooLargeError

class SqsMessageTooLargeError extends SqsError
ExtendsSqsError

Error thrown when a message exceeds the size limit.

NameDescription
name
kind
size
maxSize
Constructor
new SqsMessageTooLargeError(
  message: string,
  size: number,
  maxSize: number,
  options?: SqsErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"message_too_large"
  • readonlysizenumber
  • readonlymaxSizenumber
class

#SqsQueueNotFoundError

class SqsQueueNotFoundError extends SqsError
ExtendsSqsError

Error thrown when a queue is not found.

NameDescription
name
kind
queueUrl
Constructor
new SqsQueueNotFoundError(
  message: string,
  queueUrl: string,
  options?: SqsErrorOptions,
)
Properties
  • readonlynamestring
  • readonlykind"queue_not_found"
  • readonlyqueueUrlstring

Interfaces

interface

#AnythingExpectation

interface AnythingExpectation

Chainable expectation interface for any value using @std/expect matchers.

Unlike @std/expect which returns void from matchers, this interface returns this to enable method chaining.

NameDescription
notNegates the next assertion.
toBe()Asserts that the value is strictly equal (`===`) to the expected value.
toEqual()Asserts that the value is deeply equal to the expected value.
toStrictEqual()Asserts that the value is strictly deeply equal to the expected value.
toMatch()Asserts that the string matches the expected pattern.
toMatchObject()Asserts that the object matches a subset of properties.
toBeDefined()Asserts that the value is not `undefined`.
toBeUndefined()Asserts that the value is `undefined`.
toBeNull()Asserts that the value is `null`.
toBeNaN()Asserts that the value is `NaN`.
toBeTruthy()Asserts that the value is truthy (not `false`, `0`, `""`, `null`, `undefined`, or `NaN`).
toBeFalsy()Asserts that the value is falsy (`false`, `0`, `""`, `null`, `undefined`, or `NaN`).
toContain()Asserts that an array or string contains the expected item or substring.
toContainEqual()Asserts that an array contains an item equal to the expected value.
toHaveLength()Asserts that the array or string has the expected length.
toBeGreaterThan()Asserts that the number is greater than the expected value.
toBeGreaterThanOrEqual()Asserts that the number is greater than or equal to the expected value.
toBeLessThan()Asserts that the number is less than the expected value.
toBeLessThanOrEqual()Asserts that the number is less than or equal to the expected value.
toBeCloseTo()Asserts that the number is close to the expected value within a certain precision.
toBeInstanceOf()Asserts that the value is an instance of the expected class.
toThrow()Asserts that a function throws an error matching the expected pattern.
toHaveProperty()Asserts that the object has a property at the specified path.
toHaveBeenCalled()Asserts that a mock function was called at least once.
toHaveBeenCalledTimes()Asserts that a mock function was called exactly the specified number of times.
toHaveBeenCalledWith()Asserts that a mock function was called with the specified arguments.
toHaveBeenLastCalledWith()Asserts that a mock function was last called with the specified arguments.
toHaveBeenNthCalledWith()Asserts that the nth call of a mock function was with the specified arguments.
toHaveReturned()Asserts that a mock function returned successfully at least once.
toHaveReturnedTimes()Asserts that a mock function returned successfully the specified number of times.
toHaveReturnedWith()Asserts that a mock function returned the specified value at least once.
toHaveLastReturnedWith()Asserts that a mock function last returned the specified value.
toHaveNthReturnedWith()Asserts that the nth call of a mock function returned the specified value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBe(expected: unknown): this

Asserts that the value is strictly equal (===) to the expected value.

Parameters
  • expectedunknown
    • The expected value
toEqual(expected: unknown): this

Asserts that the value is deeply equal to the expected value.

Parameters
  • expectedunknown
    • The expected value
toStrictEqual(expected: unknown): this

Asserts that the value is strictly deeply equal to the expected value. Unlike toEqual, this checks object types and undefined properties.

Parameters
  • expectedunknown
    • The expected value
toMatch(expected: string | RegExp): this

Asserts that the string matches the expected pattern.

Parameters
  • expectedstring | RegExp
    • A string or RegExp pattern
toMatchObject(expected: Record<string, unknown>): this

Asserts that the object matches a subset of properties.

Parameters
  • expectedRecord<string, unknown>
    • An object containing expected properties
toBeDefined(): this

Asserts that the value is not undefined.

toBeUndefined(): this

Asserts that the value is undefined.

toBeNull(): this

Asserts that the value is null.

toBeNaN(): this

Asserts that the value is NaN.

toBeTruthy(): this

Asserts that the value is truthy (not false, 0, "", null, undefined, or NaN).

toBeFalsy(): this

Asserts that the value is falsy (false, 0, "", null, undefined, or NaN).

toContain(expected: unknown): this

Asserts that an array or string contains the expected item or substring.

Parameters
  • expectedunknown
    • The item or substring to check for
toContainEqual(expected: unknown): this

Asserts that an array contains an item equal to the expected value.

Parameters
  • expectedunknown
    • The item to check for equality
toHaveLength(expected: number): this

Asserts that the array or string has the expected length.

Parameters
  • expectednumber
    • The expected length
toBeGreaterThan(expected: number): this

Asserts that the number is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toBeGreaterThanOrEqual(expected: number): this

Asserts that the number is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toBeLessThan(expected: number): this

Asserts that the number is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toBeLessThanOrEqual(expected: number): this

Asserts that the number is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toBeCloseTo(expected: number, numDigits?: number): this

Asserts that the number is close to the expected value within a certain precision.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • Number of decimal digits to check (default: 2)
toBeInstanceOf(expected: (_: any[]) => unknown): this

Asserts that the value is an instance of the expected class.

Parameters
  • expected(_: any[]) => unknown
    • The expected constructor/class
toThrow(expected?: string | RegExp | Error): this

Asserts that a function throws an error matching the expected pattern.

Parameters
  • expected?string | RegExp | Error
    • Optional string, RegExp, or Error to match
toHaveProperty(keyPath: string | string[], expectedValue?: unknown): this

Asserts that the object has a property at the specified path.

Parameters
  • keyPathstring | string[]
    • The property path (string or array of strings)
  • expectedValue?unknown
    • Optional expected value at the path
toHaveBeenCalled(): this

Asserts that a mock function was called at least once.

toHaveBeenCalledTimes(expected: number): this

Asserts that a mock function was called exactly the specified number of times.

Parameters
  • expectednumber
    • The expected number of calls
toHaveBeenCalledWith(_: unknown[]): this

Asserts that a mock function was called with the specified arguments.

Parameters
  • _unknown[]
toHaveBeenLastCalledWith(_: unknown[]): this

Asserts that a mock function was last called with the specified arguments.

Parameters
  • _unknown[]
toHaveBeenNthCalledWith(n: number, _: unknown[]): this

Asserts that the nth call of a mock function was with the specified arguments.

Parameters
  • nnumber
    • The call index (1-based)
  • _unknown[]
toHaveReturned(): this

Asserts that a mock function returned successfully at least once.

toHaveReturnedTimes(expected: number): this

Asserts that a mock function returned successfully the specified number of times.

Parameters
  • expectednumber
    • The expected number of successful returns
toHaveReturnedWith(expected: unknown): this

Asserts that a mock function returned the specified value at least once.

Parameters
  • expectedunknown
    • The expected return value
toHaveLastReturnedWith(expected: unknown): this

Asserts that a mock function last returned the specified value.

Parameters
  • expectedunknown
    • The expected return value
toHaveNthReturnedWith(n: number, expected: unknown): this

Asserts that the nth call of a mock function returned the specified value.

Parameters
  • nnumber
    • The call index (1-based)
  • expectedunknown
    • The expected return value
interface

#AtomicBuilderOptions

interface AtomicBuilderOptions

Options for atomic operations.

NameDescription
throwOnErrorWhether to throw errors instead of returning them in the result.
Properties
  • readonlythrowOnError?boolean

    Whether to throw errors instead of returning them in the result.

interface

#ConnectRpcClient

interface ConnectRpcClient extends AsyncDisposable

ConnectRPC client interface.

Field Name Conventions

This client automatically handles field name conversion between protobuf and JavaScript:

  • Request fields: Accept both snake_case (protobuf style) and camelCase (JavaScript style)
  • Response fields: Converted to JavaScript conventions based on response type:
    • response.data: Plain JSON object with camelCase field names (no $typeName)
    • response.raw: Original protobuf Message object with all metadata (includes $typeName)
Examples
const client = createConnectRpcClient({ url: "http://localhost:50051" });

// Request: Both formats work
await client.call("echo.Echo", "echoWithDelay", {
  message: "hello",
  delayMs: 100,        // camelCase (recommended)
  // delay_ms: 100,    // snake_case also works
});

// Response: data is JSON, raw is protobuf Message
const response = await client.call("echo.Echo", "echo", { message: "test" });
console.log(response.data);  // { message: "test", metadata: {...} }
console.log(response.raw);   // { $typeName: "echo.EchoResponse", message: "test", ... }
NameDescription
configClient configuration
reflectionReflection API (only available when schema: "reflection")
call()Make a unary RPC call.
serverStream()Make a server streaming RPC call.
clientStream()Make a client streaming RPC call.
bidiStream()Make a bidirectional streaming RPC call.
close()Close the client connection.
Properties
Methods
call<TRequest>(
  serviceName: string,
  methodName: string,
  request: TRequest,
  options?: ConnectRpcOptions,
): Promise<ConnectRpcResponse>

Make a unary RPC call.

Parameters
  • serviceNamestring
    • Service name (e.g., "echo.EchoService")
  • methodNamestring
    • Method name (e.g., "echo")
  • requestTRequest
    • Request message
    • Call options
serverStream<TRequest>(
  serviceName: string,
  methodName: string,
  request: TRequest,
  options?: ConnectRpcOptions,
): AsyncIterable<ConnectRpcResponse>

Make a server streaming RPC call.

Parameters
  • serviceNamestring
    • Service name
  • methodNamestring
    • Method name
  • requestTRequest
    • Request message
    • Call options
clientStream<TRequest>(
  serviceName: string,
  methodName: string,
  requests: AsyncIterable<TRequest>,
  options?: ConnectRpcOptions,
): Promise<ConnectRpcResponse>

Make a client streaming RPC call.

Parameters
  • serviceNamestring
    • Service name
  • methodNamestring
    • Method name
  • requestsAsyncIterable<TRequest>
    • Async iterable of request messages
    • Call options
bidiStream<TRequest>(
  serviceName: string,
  methodName: string,
  requests: AsyncIterable<TRequest>,
  options?: ConnectRpcOptions,
): AsyncIterable<ConnectRpcResponse>

Make a bidirectional streaming RPC call.

Parameters
  • serviceNamestring
    • Service name
  • methodNamestring
    • Method name
  • requestsAsyncIterable<TRequest>
    • Async iterable of request messages
    • Call options
close(): Promise<void>

Close the client connection.

interface

#ConnectRpcClientConfig

interface ConnectRpcClientConfig extends CommonOptions

Configuration for creating a ConnectRPC client.

NameDescription
urlServer URL for ConnectRPC connections.
protocolProtocol to use.
httpVersionHTTP version to use.
tlsTLS configuration.
metadataDefault metadata to send with every request.
schemaSchema resolution configuration.
useBinaryFormatWhether to use binary format for messages.
throwOnErrorWhether to throw ConnectRpcError on non-OK responses (code !== 0) or failures.
Properties
  • readonlyurlstring | ConnectRpcConnectionConfig

    Server URL for ConnectRPC connections.

    Can be a URL string or a connection configuration object.

  • readonlyprotocol?ConnectProtocol

    Protocol to use.

  • readonlyhttpVersion?HttpVersion

    HTTP version to use.

  • readonlytls?TlsConfig

    TLS configuration. If not provided, uses insecure credentials.

  • readonlymetadata?HeadersInit

    Default metadata to send with every request.

  • readonlyschema?"reflection" | string | Uint8Array | FileDescriptorSet

    Schema resolution configuration.

    • "reflection": Use Server Reflection to discover services dynamically (default)
    • string: Path to FileDescriptorSet binary file (from buf build --output set.binpb)
    • Uint8Array: FileDescriptorSet binary data
    • FileDescriptorSet: Pre-parsed FileDescriptorSet message object
  • readonlyuseBinaryFormat?boolean

    Whether to use binary format for messages.

  • readonlythrowOnError?boolean

    Whether to throw ConnectRpcError on non-OK responses (code !== 0) or failures. Can be overridden per-request via ConnectRpcOptions.throwOnError.

interface

#ConnectRpcConnectionConfig

interface ConnectRpcConnectionConfig extends CommonConnectionConfig

ConnectRPC connection configuration.

Extends CommonConnectionConfig with ConnectRPC-specific options.

NameDescription
protocolProtocol to use.
pathService path prefix.
Properties
  • readonlyprotocol?"http" | "https"

    Protocol to use.

  • readonlypath?string

    Service path prefix.

interface

#ConnectRpcErrorOptions

interface ConnectRpcErrorOptions extends ErrorOptions

Options for ConnectRpcError construction.

NameDescription
metadataHeaders/metadata from the ConnectRPC response.
detailsRich error details from google.rpc.Status.
Properties
  • readonlymetadata?Headers | null

    Headers/metadata from the ConnectRPC response.

  • readonlydetails?readonly ErrorDetail[] | null

    Rich error details from google.rpc.Status.

interface

#ConnectRpcOptions

interface ConnectRpcOptions extends CommonOptions

Options for individual ConnectRPC calls.

NameDescription
metadataMetadata to send with the request.
throwOnErrorWhether to throw ConnectRpcError on non-OK responses (code !== 0) or failures.
Properties
  • readonlymetadata?HeadersInit

    Metadata to send with the request.

  • readonlythrowOnError?boolean

    Whether to throw ConnectRpcError on non-OK responses (code !== 0) or failures. Overrides ConnectRpcClientConfig.throwOnError.

interface

#ConnectRpcResponseError

interface ConnectRpcResponseError<T = any> extends ConnectRpcResponseBase<T>

ConnectRPC response with gRPC error (statusCode !== 0).

The server processed the request but returned an error status.

NameDescription
processed
ok
error
statusCodegRPC status code (1-16).
statusMessageStatus message describing the error.
headersResponse headers.
trailersResponse trailers (sent at end of RPC).
rawRaw ConnectError.
dataNo data for error responses.
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorConnectRpcError
  • readonlystatusCodeConnectRpcStatusCode

    gRPC status code (1-16).

  • readonlystatusMessagestring

    Status message describing the error.

  • readonlyheadersHeaders

    Response headers.

  • readonlytrailersHeaders

    Response trailers (sent at end of RPC).

  • readonlyrawConnectError

    Raw ConnectError.

  • readonlydatanull

    No data for error responses.

interface

#ConnectRpcResponseErrorParams

interface ConnectRpcResponseErrorParams

Parameters for creating an error ConnectRpcResponse.

NameDescription
error
rpcError
headers
trailers
duration
Properties
  • readonlyerrorConnectError
  • readonlyrpcErrorConnectRpcError
  • readonlyheadersHeaders
  • readonlytrailersHeaders
  • readonlydurationnumber
interface

#ConnectRpcResponseExpectation

interface ConnectRpcResponseExpectation

Fluent assertion interface for ConnectRpcResponse.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the response is successful (code 0).
toHaveStatusCode()Asserts that the code equals the expected value.
toHaveStatusCodeEqual()Asserts that the code equals the expected value using deep equality.
toHaveStatusCodeStrictEqual()Asserts that the code strictly equals the expected value.
toHaveStatusCodeSatisfying()Asserts that the code satisfies the provided matcher function.
toHaveStatusCodeNaN()Asserts that the code is NaN.
toHaveStatusCodeGreaterThan()Asserts that the code is greater than the expected value.
toHaveStatusCodeGreaterThanOrEqual()Asserts that the code is greater than or equal to the expected value.
toHaveStatusCodeLessThan()Asserts that the code is less than the expected value.
toHaveStatusCodeLessThanOrEqual()Asserts that the code is less than or equal to the expected value.
toHaveStatusCodeCloseTo()Asserts that the code is close to the expected value.
toHaveStatusCodeOneOf()Asserts that the code is one of the specified values.
toHaveStatusMessage()Asserts that the message equals the expected value.
toHaveStatusMessageEqual()Asserts that the message equals the expected value using deep equality.
toHaveStatusMessageStrictEqual()Asserts that the message strictly equals the expected value.
toHaveStatusMessageSatisfying()Asserts that the message satisfies the provided matcher function.
toHaveStatusMessageContaining()Asserts that the message contains the specified substring.
toHaveStatusMessageMatching()Asserts that the message matches the specified regular expression.
toHaveStatusMessagePresent()Asserts that the message is present (not null or undefined).
toHaveStatusMessageNull()Asserts that the message is null.
toHaveStatusMessageUndefined()Asserts that the message is undefined.
toHaveStatusMessageNullish()Asserts that the message is nullish (null or undefined).
toHaveHeaders()Asserts that the headers equal the expected value.
toHaveHeadersEqual()Asserts that the headers equal the expected value using deep equality.
toHaveHeadersStrictEqual()Asserts that the headers strictly equal the expected value.
toHaveHeadersSatisfying()Asserts that the headers satisfy the provided matcher function.
toHaveHeadersMatching()Asserts that the headers match the specified subset.
toHaveHeadersProperty()Asserts that the headers have the specified property.
toHaveHeadersPropertyContaining()Asserts that the headers property contains the expected value.
toHaveHeadersPropertyMatching()Asserts that the headers property matches the specified subset.
toHaveHeadersPropertySatisfying()Asserts that the headers property satisfies the provided matcher function.
toHaveTrailers()Asserts that the trailers equal the expected value.
toHaveTrailersEqual()Asserts that the trailers equal the expected value using deep equality.
toHaveTrailersStrictEqual()Asserts that the trailers strictly equal the expected value.
toHaveTrailersSatisfying()Asserts that the trailers satisfy the provided matcher function.
toHaveTrailersMatching()Asserts that the trailers match the specified subset.
toHaveTrailersProperty()Asserts that the trailers have the specified property.
toHaveTrailersPropertyContaining()Asserts that the trailers property contains the expected value.
toHaveTrailersPropertyMatching()Asserts that the trailers property matches the specified subset.
toHaveTrailersPropertySatisfying()Asserts that the trailers property satisfies the provided matcher function.
toHaveData()Asserts that the data equals the expected value.
toHaveDataEqual()Asserts that the data equals the expected value using deep equality.
toHaveDataStrictEqual()Asserts that the data strictly equals the expected value.
toHaveDataSatisfying()Asserts that the data satisfies the provided matcher function.
toHaveDataPresent()Asserts that the data is present (not null or undefined).
toHaveDataNull()Asserts that the data is null.
toHaveDataUndefined()Asserts that the data is undefined.
toHaveDataNullish()Asserts that the data is nullish (null or undefined).
toHaveDataMatching()Asserts that the data matches the specified subset.
toHaveDataProperty()Asserts that the data has the specified property.
toHaveDataPropertyContaining()Asserts that the data property contains the expected value.
toHaveDataPropertyMatching()Asserts that the data property matches the specified subset.
toHaveDataPropertySatisfying()Asserts that the data property satisfies the provided matcher function.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the response is successful (code 0).

toHaveStatusCode(expected: unknown): this

Asserts that the code equals the expected value.

Parameters
  • expectedunknown
    • The expected code value
toHaveStatusCodeEqual(expected: unknown): this

Asserts that the code equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected code value
toHaveStatusCodeStrictEqual(expected: unknown): this

Asserts that the code strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected code value
toHaveStatusCodeSatisfying(
  matcher: (value: ConnectRpcStatusCode) => unknown,
): this

Asserts that the code satisfies the provided matcher function.

Parameters
  • matcher(value: ConnectRpcStatusCode) => unknown
    • A function that receives the code and performs assertions
toHaveStatusCodeNaN(): this

Asserts that the code is NaN.

toHaveStatusCodeGreaterThan(expected: number): this

Asserts that the code is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusCodeGreaterThanOrEqual(expected: number): this

Asserts that the code is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusCodeLessThan(expected: number): this

Asserts that the code is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusCodeLessThanOrEqual(expected: number): this

Asserts that the code is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusCodeCloseTo(expected: number, numDigits?: number): this

Asserts that the code is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveStatusCodeOneOf(values: unknown[]): this

Asserts that the code is one of the specified values.

Parameters
  • valuesunknown[]
    • Array of acceptable values
toHaveStatusMessage(expected: unknown): this

Asserts that the message equals the expected value.

Parameters
  • expectedunknown
    • The expected message value
toHaveStatusMessageEqual(expected: unknown): this

Asserts that the message equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected message value
toHaveStatusMessageStrictEqual(expected: unknown): this

Asserts that the message strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected message value
toHaveStatusMessageSatisfying(matcher: (value: string) => unknown): this

Asserts that the message satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the message and performs assertions
toHaveStatusMessageContaining(substr: string): this

Asserts that the message contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveStatusMessageMatching(expected: RegExp): this

Asserts that the message matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveStatusMessagePresent(): this

Asserts that the message is present (not null or undefined).

toHaveStatusMessageNull(): this

Asserts that the message is null.

toHaveStatusMessageUndefined(): this

Asserts that the message is undefined.

toHaveStatusMessageNullish(): this

Asserts that the message is nullish (null or undefined).

toHaveHeaders(expected: unknown): this

Asserts that the headers equal the expected value.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersEqual(expected: unknown): this

Asserts that the headers equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersStrictEqual(expected: unknown): this

Asserts that the headers strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersSatisfying(matcher: (value: ConnectRpcHeaders) => unknown): this

Asserts that the headers satisfy the provided matcher function.

Parameters
  • matcher(value: ConnectRpcHeaders) => unknown
    • A function that receives the headers and performs assertions
toHaveHeadersMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the headers match the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveHeadersProperty(keyPath: string | string[], value?: unknown): this

Asserts that the headers have the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveHeadersPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the headers property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveHeadersPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the headers property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveHeadersPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the headers property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveTrailers(expected: unknown): this

Asserts that the trailers equal the expected value.

Parameters
  • expectedunknown
    • The expected trailers value
toHaveTrailersEqual(expected: unknown): this

Asserts that the trailers equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected trailers value
toHaveTrailersStrictEqual(expected: unknown): this

Asserts that the trailers strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected trailers value
toHaveTrailersSatisfying(matcher: (value: ConnectRpcTrailers) => unknown): this

Asserts that the trailers satisfy the provided matcher function.

Parameters
  • matcher(value: ConnectRpcTrailers) => unknown
    • A function that receives the trailers and performs assertions
toHaveTrailersMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the trailers match the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveTrailersProperty(keyPath: string | string[], value?: unknown): this

Asserts that the trailers have the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveTrailersPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the trailers property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveTrailersPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the trailers property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveTrailersPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the trailers property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveData(expected: unknown): this

Asserts that the data equals the expected value.

Parameters
  • expectedunknown
    • The expected data value
toHaveDataEqual(expected: unknown): this

Asserts that the data equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected data value
toHaveDataStrictEqual(expected: unknown): this

Asserts that the data strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected data value
toHaveDataSatisfying(
  matcher: (value: Record<string, any> | null) => unknown,
): this

Asserts that the data satisfies the provided matcher function.

Parameters
  • matcher(value: Record<string, any> | null) => unknown
    • A function that receives the data and performs assertions
toHaveDataPresent(): this

Asserts that the data is present (not null or undefined).

toHaveDataNull(): this

Asserts that the data is null.

toHaveDataUndefined(): this

Asserts that the data is undefined.

toHaveDataNullish(): this

Asserts that the data is nullish (null or undefined).

toHaveDataMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the data matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveDataProperty(keyPath: string | string[], value?: unknown): this

Asserts that the data has the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveDataPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the data property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveDataPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the data property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveDataPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the data property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#ConnectRpcResponseFailure

interface ConnectRpcResponseFailure<T = any> extends ConnectRpcResponseBase<T>

Failed ConnectRPC request (network error, connection refused, etc.).

The request did not reach gRPC processing.

NameDescription
processed
ok
error
statusCodeStatus code (null for network failures).
statusMessageStatus message (null for network failures).
headersResponse headers (null for failures).
trailersResponse trailers (null for failures).
rawNo raw response (request didn't reach server).
dataNo data (request didn't reach server).
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlystatusCodenull

    Status code (null for network failures).

  • readonlystatusMessagenull

    Status message (null for network failures).

  • readonlyheadersnull

    Response headers (null for failures).

  • readonlytrailersnull

    Response trailers (null for failures).

  • readonlyrawnull

    No raw response (request didn't reach server).

  • readonlydatanull

    No data (request didn't reach server).

interface

#ConnectRpcResponseFailureParams

interface ConnectRpcResponseFailureParams

Parameters for creating a failure ConnectRpcResponse.

NameDescription
error
duration
Properties
interface

#ConnectRpcResponseSuccess

interface ConnectRpcResponseSuccess<T = any> extends ConnectRpcResponseBase<T>

Successful ConnectRPC response (statusCode === 0).

NameDescription
processed
ok
error
statusCodegRPC status code (always 0 for success).
statusMessageStatus message (null for successful responses).
headersResponse headers.
trailersResponse trailers (sent at end of RPC).
rawRaw protobuf Message object.
dataResponse data as plain JavaScript object (JSON representation).
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlystatusCode0

    gRPC status code (always 0 for success).

  • readonlystatusMessagenull

    Status message (null for successful responses).

  • readonlyheadersHeaders

    Response headers.

  • readonlytrailersHeaders

    Response trailers (sent at end of RPC).

  • readonlyrawunknown

    Raw protobuf Message object.

  • readonlydataT | null

    Response data as plain JavaScript object (JSON representation).

interface

#ConnectRpcResponseSuccessParams

interface ConnectRpcResponseSuccessParams<T = any>

Parameters for creating a successful ConnectRpcResponse.

NameDescription
response
schema
headers
trailers
duration
Properties
  • readonlyresponseT | null
  • readonlyschemaDescMessage | null
  • readonlyheadersHeaders
  • readonlytrailersHeaders
  • readonlydurationnumber
interface

#CookieConfig

interface CookieConfig

Cookie handling configuration.

NameDescription
disabledDisable automatic cookie handling.
initialInitial cookies to populate the cookie jar.
Properties
  • readonlydisabled?boolean

    Disable automatic cookie handling. When disabled, cookies are not stored or sent automatically.

  • readonlyinitial?Record<string, string>

    Initial cookies to populate the cookie jar.

interface

#DenoKvAtomicBuilder

interface DenoKvAtomicBuilder

Builder for atomic KV operations.

NameDescription
check()Add version checks to the atomic operation.
set()Set a value in the KV store.
delete()Delete a key from the KV store.
sum()Atomically add to a bigint value (Deno.KvU64).
min()Atomically set to minimum of current and provided value.
max()Atomically set to maximum of current and provided value.
commit()Commit the atomic operation.
Methods
check(_: Deno.AtomicCheck[]): this

Add version checks to the atomic operation. If any check fails, the entire operation will fail.

Parameters
  • _Deno.AtomicCheck[]
set<T = any>(key: Deno.KvKey, value: T, options?: { expireIn?: number }): this

Set a value in the KV store.

Parameters
  • keyDeno.KvKey
  • valueT
  • options?{ expireIn?: number }
delete(key: Deno.KvKey): this

Delete a key from the KV store.

Parameters
  • keyDeno.KvKey
sum(key: Deno.KvKey, n: bigint): this

Atomically add to a bigint value (Deno.KvU64).

Parameters
  • keyDeno.KvKey
  • nbigint
min(key: Deno.KvKey, n: bigint): this

Atomically set to minimum of current and provided value.

Parameters
  • keyDeno.KvKey
  • nbigint
max(key: Deno.KvKey, n: bigint): this

Atomically set to maximum of current and provided value.

Parameters
  • keyDeno.KvKey
  • nbigint
commit(): Promise<DenoKvAtomicResult>

Commit the atomic operation.

interface

#DenoKvAtomicOptions

interface DenoKvAtomicOptions extends DenoKvOptions

Options for atomic operations.

interface

#DenoKvAtomicResultCheckFailed

interface DenoKvAtomicResultCheckFailed extends DenoKvAtomicResultBase

Atomic operation check failed (version mismatch).

This is NOT an error - it's an expected outcome when using optimistic concurrency. Retry the operation with updated versionstamps.

NameDescription
processed
ok
error
versionstamp
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrornull
  • readonlyversionstampnull
interface

#DenoKvAtomicResultCommitted

interface DenoKvAtomicResultCommitted extends DenoKvAtomicResultBase

Atomic operation successfully committed.

NameDescription
processed
ok
error
versionstamp
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyversionstampstring
interface

#DenoKvAtomicResultError

interface DenoKvAtomicResultError extends DenoKvAtomicResultBase

Atomic operation failed with KV error.

NameDescription
processed
ok
error
versionstamp
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorDenoKvError
  • readonlyversionstampnull
interface

#DenoKvAtomicResultExpectation

interface DenoKvAtomicResultExpectation

Fluent API for validating DenoKvAtomicResult.

Provides chainable assertions specifically designed for Deno KV atomic operation results. All assertion methods return this to enable method chaining.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveVersionstamp()Asserts that the versionstamp equals the expected value.
toHaveVersionstampEqual()Asserts that the versionstamp equals the expected value using deep equality.
toHaveVersionstampStrictEqual()Asserts that the versionstamp strictly equals the expected value.
toHaveVersionstampSatisfying()Asserts that the versionstamp satisfies the provided matcher function.
toHaveVersionstampContaining()Asserts that the versionstamp contains the specified substring.
toHaveVersionstampMatching()Asserts that the versionstamp matches the specified regular expression.
toHaveVersionstampPresent()Asserts that the versionstamp is present (not null or undefined).
toHaveVersionstampNull()Asserts that the versionstamp is null.
toHaveVersionstampUndefined()Asserts that the versionstamp is undefined.
toHaveVersionstampNullish()Asserts that the versionstamp is nullish (null or undefined).
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveVersionstamp(expected: unknown): this

Asserts that the versionstamp equals the expected value.

Parameters
  • expectedunknown
    • The expected versionstamp value
toHaveVersionstampEqual(expected: unknown): this

Asserts that the versionstamp equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected versionstamp value
toHaveVersionstampStrictEqual(expected: unknown): this

Asserts that the versionstamp strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected versionstamp value
toHaveVersionstampSatisfying(matcher: (value: string) => unknown): this

Asserts that the versionstamp satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the versionstamp and performs assertions
toHaveVersionstampContaining(substr: string): this

Asserts that the versionstamp contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveVersionstampMatching(expected: RegExp): this

Asserts that the versionstamp matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveVersionstampPresent(): this

Asserts that the versionstamp is present (not null or undefined).

toHaveVersionstampNull(): this

Asserts that the versionstamp is null.

toHaveVersionstampUndefined(): this

Asserts that the versionstamp is undefined.

toHaveVersionstampNullish(): this

Asserts that the versionstamp is nullish (null or undefined).

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#DenoKvAtomicResultFailure

interface DenoKvAtomicResultFailure extends DenoKvAtomicResultBase

Atomic operation failed with connection error.

NameDescription
processed
ok
error
versionstamp
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorDenoKvFailureError
  • readonlyversionstampnull
interface

#DenoKvClient

interface DenoKvClient extends AsyncDisposable

Deno KV client for Probitas scenario testing.

NameDescription
configClient configuration.
get()Get a single value by key.
getMany()Get multiple values by keys.
set()Set a value.
delete()Delete a key.
list()List entries by selector.
atomic()Create an atomic operation builder.
close()Close the KV connection.
Properties
Methods
get<T = any>(
  key: Deno.KvKey,
  options?: DenoKvGetOptions,
): Promise<DenoKvGetResult<T>>

Get a single value by key.

Parameters
getMany<T extends readonly any[]>(
  keys: readonly [unknown],
  options?: DenoKvGetOptions,
): Promise<unknown>

Get multiple values by keys.

Parameters
set<T = any>(
  key: Deno.KvKey,
  value: T,
  options?: DenoKvSetOptions,
): Promise<DenoKvSetResult>

Set a value.

Parameters
delete(
  key: Deno.KvKey,
  options?: DenoKvDeleteOptions,
): Promise<DenoKvDeleteResult>

Delete a key.

Parameters
list<T = any>(
  selector: Deno.KvListSelector,
  options?: DenoKvListOptions,
): Promise<DenoKvListResult<T>>

List entries by selector.

Parameters
atomic(options?: DenoKvAtomicOptions): DenoKvAtomicBuilder

Create an atomic operation builder.

Parameters
close(): Promise<void>

Close the KV connection.

interface

#DenoKvClientConfig

interface DenoKvClientConfig extends DenoKvOptions

Configuration for DenoKvClient.

NameDescription
pathPath to the KV database file.
Properties
  • readonlypath?string

    Path to the KV database file. If not specified, uses in-memory storage or Deno Deploy's KV.

interface

#DenoKvDeleteOptions

interface DenoKvDeleteOptions extends DenoKvOptions

Options for delete operations.

interface

#DenoKvDeleteResultError

interface DenoKvDeleteResultError extends DenoKvDeleteResultBase

Delete operation result with KV error.

NameDescription
processed
ok
error
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorDenoKvError
interface

#DenoKvDeleteResultExpectation

interface DenoKvDeleteResultExpectation

Fluent API for validating DenoKvDeleteResult.

Provides chainable assertions specifically designed for Deno KV delete operation results. All assertion methods return this to enable method chaining.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#DenoKvDeleteResultFailure

interface DenoKvDeleteResultFailure extends DenoKvDeleteResultBase

Delete operation result with connection failure.

NameDescription
processed
ok
error
Properties
interface

#DenoKvDeleteResultSuccess

interface DenoKvDeleteResultSuccess extends DenoKvDeleteResultBase

Successful delete operation result.

NameDescription
processed
ok
error
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
interface

#DenoKvEntry

interface DenoKvEntry<T = any>

A single entry in the KV store.

NameDescription
key
value
versionstamp
Properties
  • readonlykeyDeno.KvKey
  • readonlyvalueT
  • readonlyversionstampstring
interface

#DenoKvGetOptions

interface DenoKvGetOptions extends DenoKvOptions

Options for get operations.

interface

#DenoKvGetResultError

interface DenoKvGetResultError<T = any> extends DenoKvGetResultBase<T>

Get operation result with KV error (quota exceeded, etc.).

NameDescription
processed
ok
error
key
value
versionstamp
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorDenoKvError
  • readonlykeyDeno.KvKey
  • readonlyvaluenull
  • readonlyversionstampnull
interface

#DenoKvGetResultExpectation

interface DenoKvGetResultExpectation<_T = unknown>

Fluent API for validating DenoKvGetResult.

Provides chainable assertions specifically designed for Deno KV get operation results. All assertion methods return this to enable method chaining.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveKey()Asserts that the key equals the expected value.
toHaveKeyEqual()Asserts that the key equals the expected value using deep equality.
toHaveKeyStrictEqual()Asserts that the key strictly equals the expected value.
toHaveKeySatisfying()Asserts that the key satisfies the provided matcher function.
toHaveKeyContaining()Asserts that the key array contains the specified item.
toHaveKeyContainingEqual()Asserts that the key array contains an item equal to the specified value.
toHaveKeyMatching()Asserts that the key array matches the specified subset.
toHaveKeyEmpty()Asserts that the key array is empty.
toHaveValue()Asserts that the value equals the expected value.
toHaveValueEqual()Asserts that the value equals the expected value using deep equality.
toHaveValueStrictEqual()Asserts that the value strictly equals the expected value.
toHaveValueSatisfying()Asserts that the value satisfies the provided matcher function.
toHaveValuePresent()Asserts that the value is present (not null or undefined).
toHaveValueNull()Asserts that the value is null.
toHaveValueUndefined()Asserts that the value is undefined.
toHaveValueNullish()Asserts that the value is nullish (null or undefined).
toHaveValueMatching()Asserts that the value matches the specified subset.
toHaveValueProperty()Asserts that the value has the specified property.
toHaveValuePropertyContaining()Asserts that the value property contains the expected value.
toHaveValuePropertyMatching()Asserts that the value property matches the specified subset.
toHaveValuePropertySatisfying()Asserts that the value property satisfies the provided matcher function.
toHaveVersionstamp()Asserts that the versionstamp equals the expected value.
toHaveVersionstampEqual()Asserts that the versionstamp equals the expected value using deep equality.
toHaveVersionstampStrictEqual()Asserts that the versionstamp strictly equals the expected value.
toHaveVersionstampSatisfying()Asserts that the versionstamp satisfies the provided matcher function.
toHaveVersionstampContaining()Asserts that the versionstamp contains the specified substring.
toHaveVersionstampMatching()Asserts that the versionstamp matches the specified regular expression.
toHaveVersionstampPresent()Asserts that the versionstamp is present (not null or undefined).
toHaveVersionstampNull()Asserts that the versionstamp is null.
toHaveVersionstampUndefined()Asserts that the versionstamp is undefined.
toHaveVersionstampNullish()Asserts that the versionstamp is nullish (null or undefined).
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveKey(expected: unknown): this

Asserts that the key equals the expected value.

Parameters
  • expectedunknown
    • The expected key value
toHaveKeyEqual(expected: unknown): this

Asserts that the key equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected key value
toHaveKeyStrictEqual(expected: unknown): this

Asserts that the key strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected key value
toHaveKeySatisfying(matcher: (value: DenoKvKey<_T>) => unknown): this

Asserts that the key satisfies the provided matcher function.

Parameters
  • matcher(value: DenoKvKey<_T>) => unknown
    • A function that receives the key and performs assertions
toHaveKeyContaining(item: unknown): this

Asserts that the key array contains the specified item.

Parameters
  • itemunknown
    • The item to search for
toHaveKeyContainingEqual(item: unknown): this

Asserts that the key array contains an item equal to the specified value.

Parameters
  • itemunknown
    • The item to search for using deep equality
toHaveKeyMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the key array matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveKeyEmpty(): this

Asserts that the key array is empty.

toHaveValue(expected: unknown): this

Asserts that the value equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueEqual(expected: unknown): this

Asserts that the value equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected value
toHaveValueStrictEqual(expected: unknown): this

Asserts that the value strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueSatisfying(matcher: (value: any) => unknown): this

Asserts that the value satisfies the provided matcher function.

Parameters
  • matcher(value: any) => unknown
    • A function that receives the value and performs assertions
toHaveValuePresent(): this

Asserts that the value is present (not null or undefined).

toHaveValueNull(): this

Asserts that the value is null.

toHaveValueUndefined(): this

Asserts that the value is undefined.

toHaveValueNullish(): this

Asserts that the value is nullish (null or undefined).

toHaveValueMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the value matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveValueProperty(keyPath: string | string[], value?: unknown): this

Asserts that the value has the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveValuePropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the value property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveValuePropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the value property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveValuePropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the value property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveVersionstamp(expected: unknown): this

Asserts that the versionstamp equals the expected value.

Parameters
  • expectedunknown
    • The expected versionstamp value
toHaveVersionstampEqual(expected: unknown): this

Asserts that the versionstamp equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected versionstamp value
toHaveVersionstampStrictEqual(expected: unknown): this

Asserts that the versionstamp strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected versionstamp value
toHaveVersionstampSatisfying(matcher: (value: string) => unknown): this

Asserts that the versionstamp satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the versionstamp and performs assertions
toHaveVersionstampContaining(substr: string): this

Asserts that the versionstamp contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveVersionstampMatching(expected: RegExp): this

Asserts that the versionstamp matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveVersionstampPresent(): this

Asserts that the versionstamp is present (not null or undefined).

toHaveVersionstampNull(): this

Asserts that the versionstamp is null.

toHaveVersionstampUndefined(): this

Asserts that the versionstamp is undefined.

toHaveVersionstampNullish(): this

Asserts that the versionstamp is nullish (null or undefined).

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#DenoKvGetResultFailure

interface DenoKvGetResultFailure<T = any> extends DenoKvGetResultBase<T>

Get operation result with connection failure.

NameDescription
processed
ok
error
key
value
versionstamp
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorDenoKvFailureError
  • readonlykeynull
  • readonlyvaluenull
  • readonlyversionstampnull
interface

#DenoKvGetResultSuccess

interface DenoKvGetResultSuccess<T = any> extends DenoKvGetResultBase<T>

Successful get operation result.

NameDescription
processed
ok
error
key
value
versionstamp
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlykeyDeno.KvKey
  • readonlyvalueT | null
  • readonlyversionstampstring | null
interface

#DenoKvListOptions

interface DenoKvListOptions extends DenoKvOptions

Options for list operations.

NameDescription
limitMaximum number of entries to return.
cursorCursor for pagination.
reverseWhether to iterate in reverse order.
Properties
  • readonlylimit?number

    Maximum number of entries to return.

  • readonlycursor?string

    Cursor for pagination.

  • readonlyreverse?boolean

    Whether to iterate in reverse order.

interface

#DenoKvListResultError

interface DenoKvListResultError<T = any> extends DenoKvListResultBase<T>

List operation result with KV error.

NameDescription
processed
ok
error
entries
Properties
interface

#DenoKvListResultExpectation

interface DenoKvListResultExpectation<_T = unknown>

Fluent API for validating DenoKvListResult.

Provides chainable assertions specifically designed for Deno KV list operation results. All assertion methods return this to enable method chaining.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveEntries()Asserts that the entries equal the expected value.
toHaveEntriesEqual()Asserts that the entries equal the expected value using deep equality.
toHaveEntriesStrictEqual()Asserts that the entries strictly equal the expected value.
toHaveEntriesSatisfying()Asserts that the entries satisfy the provided matcher function.
toHaveEntriesContaining()Asserts that the entries array contains the specified item.
toHaveEntriesContainingEqual()Asserts that the entries array contains an item equal to the specified value.
toHaveEntriesMatching()Asserts that the entries array matches the specified subset.
toHaveEntriesEmpty()Asserts that the entries array is empty.
toHaveEntryCount()Asserts that the entry count equals the expected value.
toHaveEntryCountEqual()Asserts that the entry count equals the expected value using deep equality.
toHaveEntryCountStrictEqual()Asserts that the entry count strictly equals the expected value.
toHaveEntryCountSatisfying()Asserts that the entry count satisfies the provided matcher function.
toHaveEntryCountNaN()Asserts that the entry count is NaN.
toHaveEntryCountGreaterThan()Asserts that the entry count is greater than the expected value.
toHaveEntryCountGreaterThanOrEqual()Asserts that the entry count is greater than or equal to the expected value.
toHaveEntryCountLessThan()Asserts that the entry count is less than the expected value.
toHaveEntryCountLessThanOrEqual()Asserts that the entry count is less than or equal to the expected value.
toHaveEntryCountCloseTo()Asserts that the entry count is close to the expected value.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveEntries(expected: unknown): this

Asserts that the entries equal the expected value.

Parameters
  • expectedunknown
    • The expected entries value
toHaveEntriesEqual(expected: unknown): this

Asserts that the entries equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected entries value
toHaveEntriesStrictEqual(expected: unknown): this

Asserts that the entries strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected entries value
toHaveEntriesSatisfying(matcher: (value: DenoKvEntries<_T>) => unknown): this

Asserts that the entries satisfy the provided matcher function.

Parameters
  • matcher(value: DenoKvEntries<_T>) => unknown
    • A function that receives the entries and performs assertions
toHaveEntriesContaining(item: unknown): this

Asserts that the entries array contains the specified item.

Parameters
  • itemunknown
    • The item to search for
toHaveEntriesContainingEqual(item: unknown): this

Asserts that the entries array contains an item equal to the specified value.

Parameters
  • itemunknown
    • The item to search for using deep equality
toHaveEntriesMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the entries array matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveEntriesEmpty(): this

Asserts that the entries array is empty.

toHaveEntryCount(expected: unknown): this

Asserts that the entry count equals the expected value.

Parameters
  • expectedunknown
    • The expected entry count
toHaveEntryCountEqual(expected: unknown): this

Asserts that the entry count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected entry count
toHaveEntryCountStrictEqual(expected: unknown): this

Asserts that the entry count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected entry count
toHaveEntryCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the entry count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the entry count and performs assertions
toHaveEntryCountNaN(): this

Asserts that the entry count is NaN.

toHaveEntryCountGreaterThan(expected: number): this

Asserts that the entry count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveEntryCountGreaterThanOrEqual(expected: number): this

Asserts that the entry count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveEntryCountLessThan(expected: number): this

Asserts that the entry count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveEntryCountLessThanOrEqual(expected: number): this

Asserts that the entry count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveEntryCountCloseTo(expected: number, numDigits?: number): this

Asserts that the entry count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#DenoKvListResultFailure

interface DenoKvListResultFailure<T = any> extends DenoKvListResultBase<T>

List operation result with connection failure.

NameDescription
processed
ok
error
entries
Properties
interface

#DenoKvListResultSuccess

interface DenoKvListResultSuccess<T = any> extends DenoKvListResultBase<T>

Successful list operation result.

NameDescription
processed
ok
error
entries
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyentriesreadonly DenoKvEntry<T>[]
interface

#DenoKvOptions

interface DenoKvOptions extends CommonOptions

Options for Deno KV operations.

Extends CommonOptions with error handling behavior configuration.

NameDescription
throwOnErrorWhether to throw errors instead of returning them in the result.
Properties
  • readonlythrowOnError?boolean

    Whether to throw errors instead of returning them in the result.

    • false (default): Errors are returned in the result's error property
    • true: Errors are thrown as exceptions

    This applies to both KV errors (quota exceeded, etc.) and connection errors. Note: Atomic check failures are NOT errors and will never be thrown.

interface

#DenoKvSetOptions

interface DenoKvSetOptions extends DenoKvOptions

Options for set operations.

NameDescription
expireInTime-to-live in milliseconds.
Properties
  • readonlyexpireIn?number

    Time-to-live in milliseconds. The entry will automatically expire after this duration.

interface

#DenoKvSetResultError

interface DenoKvSetResultError extends DenoKvSetResultBase

Set operation result with KV error (quota exceeded, etc.).

NameDescription
processed
ok
error
versionstamp
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorDenoKvError
  • readonlyversionstampnull
interface

#DenoKvSetResultExpectation

interface DenoKvSetResultExpectation

Fluent API for validating DenoKvSetResult.

Provides chainable assertions specifically designed for Deno KV set operation results. All assertion methods return this to enable method chaining.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveVersionstamp()Asserts that the versionstamp equals the expected value.
toHaveVersionstampEqual()Asserts that the versionstamp equals the expected value using deep equality.
toHaveVersionstampStrictEqual()Asserts that the versionstamp strictly equals the expected value.
toHaveVersionstampSatisfying()Asserts that the versionstamp satisfies the provided matcher function.
toHaveVersionstampContaining()Asserts that the versionstamp contains the specified substring.
toHaveVersionstampMatching()Asserts that the versionstamp matches the specified regular expression.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveVersionstamp(expected: unknown): this

Asserts that the versionstamp equals the expected value.

Parameters
  • expectedunknown
    • The expected versionstamp value
toHaveVersionstampEqual(expected: unknown): this

Asserts that the versionstamp equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected versionstamp value
toHaveVersionstampStrictEqual(expected: unknown): this

Asserts that the versionstamp strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected versionstamp value
toHaveVersionstampSatisfying(matcher: (value: string) => unknown): this

Asserts that the versionstamp satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the versionstamp and performs assertions
toHaveVersionstampContaining(substr: string): this

Asserts that the versionstamp contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveVersionstampMatching(expected: RegExp): this

Asserts that the versionstamp matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#DenoKvSetResultFailure

interface DenoKvSetResultFailure extends DenoKvSetResultBase

Set operation result with connection failure.

NameDescription
processed
ok
error
versionstamp
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorDenoKvFailureError
  • readonlyversionstampnull
interface

#DenoKvSetResultSuccess

interface DenoKvSetResultSuccess extends DenoKvSetResultBase

Successful set operation result.

NameDescription
processed
ok
error
versionstamp
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyversionstampstring
interface

#ErrorDetail

interface ErrorDetail

Rich error detail from google.rpc.Status.

ConnectRPC errors can include structured details encoded in error responses. These details follow the google.protobuf.Any format with a type URL and value.

NameDescription
typeUrlType URL identifying the error detail type.
valueDecoded error detail value.
Properties
  • readonlytypeUrlstring

    Type URL identifying the error detail type. Common types include:

    • "type.googleapis.com/google.rpc.BadRequest"
    • "type.googleapis.com/google.rpc.DebugInfo"
    • "type.googleapis.com/google.rpc.RetryInfo"
    • "type.googleapis.com/google.rpc.QuotaFailure"
  • readonlyvalueunknown

    Decoded error detail value. The structure depends on the typeUrl.

interface

#GraphqlClient

interface GraphqlClient extends AsyncDisposable

GraphQL client interface.

NameDescription
configClient configuration
query()Execute a GraphQL query
mutation()Execute a GraphQL mutation
execute()Execute a GraphQL document (query or mutation)
subscribe()Subscribe to a GraphQL subscription via WebSocket
close()Close the client and release resources
Properties
Methods
query<TData = any, TVariables = Record<string, any>>(
  query: string,
  variables?: TVariables,
  options?: GraphqlOptions,
): Promise<GraphqlResponse<TData>>

Execute a GraphQL query

Parameters
mutation<TData = any, TVariables = Record<string, any>>(
  mutation: string,
  variables?: TVariables,
  options?: GraphqlOptions,
): Promise<GraphqlResponse<TData>>

Execute a GraphQL mutation

Parameters
execute<TData = any, TVariables = Record<string, any>>(
  document: string,
  variables?: TVariables,
  options?: GraphqlOptions,
): Promise<GraphqlResponse<TData>>

Execute a GraphQL document (query or mutation)

Parameters
subscribe<TData = any, TVariables = Record<string, any>>(
  document: string,
  variables?: TVariables,
  options?: GraphqlOptions,
): AsyncIterable<GraphqlResponse<TData>>

Subscribe to a GraphQL subscription via WebSocket

Parameters
close(): Promise<void>

Close the client and release resources

interface

#GraphqlClientConfig

interface GraphqlClientConfig extends CommonOptions

GraphQL client configuration.

NameDescription
urlGraphQL endpoint URL.
headersDefault headers for all requests
wsEndpointWebSocket endpoint URL (for subscriptions)
fetchCustom fetch implementation (for testing/mocking)
throwOnErrorWhether to throw GraphqlError when response contains errors or request fails.
Properties
  • readonlyurlstring | GraphqlConnectionConfig

    GraphQL endpoint URL.

    Can be a URL string or a connection configuration object.

  • readonlyheaders?HeadersInit

    Default headers for all requests

  • readonlywsEndpoint?string

    WebSocket endpoint URL (for subscriptions)

  • readonlyfetch?fetch

    Custom fetch implementation (for testing/mocking)

  • readonlythrowOnError?boolean

    Whether to throw GraphqlError when response contains errors or request fails. Can be overridden per-request via GraphqlOptions.

interface

#GraphqlConnectionConfig

interface GraphqlConnectionConfig extends CommonConnectionConfig

GraphQL connection configuration.

Extends CommonConnectionConfig with GraphQL-specific options.

NameDescription
protocolProtocol to use.
pathGraphQL endpoint path.
Properties
  • readonlyprotocol?"http" | "https"

    Protocol to use.

  • readonlypath?string

    GraphQL endpoint path.

interface

#GraphqlErrorItem

interface GraphqlErrorItem

GraphQL error item as per GraphQL specification.

NameDescription
messageError message
locationsLocation(s) in the GraphQL document where the error occurred
pathPath to the field that caused the error
extensionsAdditional error metadata
Properties
  • readonlymessagestring

    Error message

  • readonlylocationsreadonly { line: number; column: number }[] | null

    Location(s) in the GraphQL document where the error occurred

  • readonlypathreadonly unknown[] | null

    Path to the field that caused the error

  • readonlyextensionsRecord<string, unknown> | null

    Additional error metadata

interface

#GraphqlOptions

interface GraphqlOptions extends CommonOptions

Options for individual GraphQL requests.

NameDescription
headersAdditional request headers
operationNameOperation name (for documents with multiple operations)
throwOnErrorWhether to throw GraphqlError when response contains errors or request fails.
Properties
  • readonlyheaders?HeadersInit

    Additional request headers

  • readonlyoperationName?string

    Operation name (for documents with multiple operations)

  • readonlythrowOnError?boolean

    Whether to throw GraphqlError when response contains errors or request fails.

interface

#GraphqlResponseError

interface GraphqlResponseError<T = any> extends GraphqlResponseBase<T>

GraphQL response with execution errors.

Note: GraphQL allows partial success where both data and errors are present. Use data() to access any partial data.

NameDescription
processed
ok
error
statusHTTP status code.
headersHTTP response headers.
extensionsResponse extensions.
rawRaw Web standard Response.
dataResponse data (null if no data, may be partial data with errors).
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlystatusnumber

    HTTP status code.

  • readonlyheadersHeaders

    HTTP response headers.

  • readonlyextensionsRecord<string, unknown> | null

    Response extensions.

  • readonlyrawglobalThis.Response

    Raw Web standard Response.

  • readonlydataT | null

    Response data (null if no data, may be partial data with errors).

interface

#GraphqlResponseErrorParams

interface GraphqlResponseErrorParams<T>

Parameters for creating an error GraphqlResponse.

NameDescription
url
data
error
extensions
duration
status
raw
Properties
  • readonlyurlstring
  • readonlydataT | null
  • readonlyextensionsRecord<string, unknown> | null
  • readonlydurationnumber
  • readonlystatusnumber
  • readonlyrawglobalThis.Response
interface

#GraphqlResponseExpectation

interface GraphqlResponseExpectation

Fluent API for GraphQL response validation.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the response is successful (no errors).
toHaveStatus()Asserts that the status equals the expected value.
toHaveStatusEqual()Asserts that the status equals the expected value using deep equality.
toHaveStatusStrictEqual()Asserts that the status strictly equals the expected value.
toHaveStatusSatisfying()Asserts that the status satisfies the provided matcher function.
toHaveStatusNaN()Asserts that the status is NaN.
toHaveStatusGreaterThan()Asserts that the status is greater than the expected value.
toHaveStatusGreaterThanOrEqual()Asserts that the status is greater than or equal to the expected value.
toHaveStatusLessThan()Asserts that the status is less than the expected value.
toHaveStatusLessThanOrEqual()Asserts that the status is less than or equal to the expected value.
toHaveStatusCloseTo()Asserts that the status is close to the expected value.
toHaveStatusOneOf()Asserts that the status is one of the specified values.
toHaveHeaders()Asserts that the headers equal the expected value.
toHaveHeadersEqual()Asserts that the headers equal the expected value using deep equality.
toHaveHeadersStrictEqual()Asserts that the headers strictly equal the expected value.
toHaveHeadersSatisfying()Asserts that the headers satisfy the provided matcher function.
toHaveHeadersMatching()Asserts that the headers match the specified subset.
toHaveHeadersProperty()Asserts that the headers have the specified property.
toHaveHeadersPropertyContaining()Asserts that the headers property contains the expected value.
toHaveHeadersPropertyMatching()Asserts that the headers property matches the specified subset.
toHaveHeadersPropertySatisfying()Asserts that the headers property satisfies the provided matcher function.
toHaveError()Asserts that the error equals the expected value.
toHaveErrorEqual()Asserts that the error equals the expected value using deep equality.
toHaveErrorStrictEqual()Asserts that the error strictly equals the expected value.
toHaveErrorSatisfying()Asserts that the error satisfies the provided matcher function.
toHaveErrorPresent()Asserts that the error is present (not null or undefined).
toHaveErrorNull()Asserts that the error is null.
toHaveErrorUndefined()Asserts that the error is undefined.
toHaveErrorNullish()Asserts that the error is nullish (null or undefined).
toHaveExtensions()Asserts that the extensions equal the expected value.
toHaveExtensionsEqual()Asserts that the extensions equal the expected value using deep equality.
toHaveExtensionsStrictEqual()Asserts that the extensions strictly equal the expected value.
toHaveExtensionsSatisfying()Asserts that the extensions satisfy the provided matcher function.
toHaveExtensionsMatching()Asserts that the extensions match the specified subset.
toHaveExtensionsProperty()Asserts that the extensions have the specified property.
toHaveExtensionsPropertyContaining()Asserts that the extensions property contains the expected value.
toHaveExtensionsPropertyMatching()Asserts that the extensions property matches the specified subset.
toHaveExtensionsPropertySatisfying()Asserts that the extensions property satisfies the provided matcher function.
toHaveExtensionsPresent()Asserts that the extensions are present (not null or undefined).
toHaveExtensionsNull()Asserts that the extensions are null.
toHaveExtensionsUndefined()Asserts that the extensions are undefined.
toHaveExtensionsNullish()Asserts that the extensions are nullish (null or undefined).
toHaveData()Asserts that the data equals the expected value.
toHaveDataEqual()Asserts that the data equals the expected value using deep equality.
toHaveDataStrictEqual()Asserts that the data strictly equals the expected value.
toHaveDataSatisfying()Asserts that the data satisfies the provided matcher function.
toHaveDataMatching()Asserts that the data matches the specified subset.
toHaveDataProperty()Asserts that the data has the specified property.
toHaveDataPropertyContaining()Asserts that the data property contains the specified value.
toHaveDataPropertyMatching()Asserts that the data property matches the specified subset.
toHaveDataPropertySatisfying()Asserts that the data property satisfies the provided matcher function.
toHaveDataPresent()Asserts that the data is present (not null or undefined).
toHaveDataNull()Asserts that the data is null.
toHaveDataUndefined()Asserts that the data is undefined.
toHaveDataNullish()Asserts that the data is nullish (null or undefined).
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the response is successful (no errors).

toHaveStatus(expected: unknown): this

Asserts that the status equals the expected value.

Parameters
  • expectedunknown
    • The expected status value
toHaveStatusEqual(expected: unknown): this

Asserts that the status equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected status value
toHaveStatusStrictEqual(expected: unknown): this

Asserts that the status strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected status value
toHaveStatusSatisfying(matcher: (value: number) => unknown): this

Asserts that the status satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the status and performs assertions
toHaveStatusNaN(): this

Asserts that the status is NaN.

toHaveStatusGreaterThan(expected: number): this

Asserts that the status is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusGreaterThanOrEqual(expected: number): this

Asserts that the status is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusLessThan(expected: number): this

Asserts that the status is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusLessThanOrEqual(expected: number): this

Asserts that the status is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusCloseTo(expected: number, numDigits?: number): this

Asserts that the status is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveStatusOneOf(values: unknown[]): this

Asserts that the status is one of the specified values.

Parameters
  • valuesunknown[]
    • Array of acceptable values
toHaveHeaders(expected: unknown): this

Asserts that the headers equal the expected value.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersEqual(expected: unknown): this

Asserts that the headers equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersStrictEqual(expected: unknown): this

Asserts that the headers strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersSatisfying(matcher: (value: GraphqlHeaders) => unknown): this

Asserts that the headers satisfy the provided matcher function.

Parameters
  • matcher(value: GraphqlHeaders) => unknown
    • A function that receives the headers and performs assertions
toHaveHeadersMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the headers match the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveHeadersProperty(keyPath: string | string[], value?: unknown): this

Asserts that the headers have the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveHeadersPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the headers property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveHeadersPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the headers property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveHeadersPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the headers property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveError(expected: unknown): this

Asserts that the error equals the expected value.

Parameters
  • expectedunknown
    • The expected error value
toHaveErrorEqual(expected: unknown): this

Asserts that the error equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected error value
toHaveErrorStrictEqual(expected: unknown): this

Asserts that the error strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected error value
toHaveErrorSatisfying(matcher: (value: any) => unknown): this

Asserts that the error satisfies the provided matcher function.

Parameters
  • matcher(value: any) => unknown
    • A function that receives the error and performs assertions
toHaveErrorPresent(): this

Asserts that the error is present (not null or undefined).

toHaveErrorNull(): this

Asserts that the error is null.

toHaveErrorUndefined(): this

Asserts that the error is undefined.

toHaveErrorNullish(): this

Asserts that the error is nullish (null or undefined).

toHaveExtensions(expected: unknown): this

Asserts that the extensions equal the expected value.

Parameters
  • expectedunknown
    • The expected extensions value
toHaveExtensionsEqual(expected: unknown): this

Asserts that the extensions equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected extensions value
toHaveExtensionsStrictEqual(expected: unknown): this

Asserts that the extensions strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected extensions value
toHaveExtensionsSatisfying(
  matcher: (value: Record<string, any>) => unknown,
): this

Asserts that the extensions satisfy the provided matcher function.

Parameters
  • matcher(value: Record<string, any>) => unknown
    • A function that receives the extensions and performs assertions
toHaveExtensionsMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the extensions match the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveExtensionsProperty(keyPath: string | string[], value?: unknown): this

Asserts that the extensions have the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveExtensionsPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the extensions property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveExtensionsPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the extensions property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveExtensionsPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the extensions property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveExtensionsPresent(): this

Asserts that the extensions are present (not null or undefined).

toHaveExtensionsNull(): this

Asserts that the extensions are null.

toHaveExtensionsUndefined(): this

Asserts that the extensions are undefined.

toHaveExtensionsNullish(): this

Asserts that the extensions are nullish (null or undefined).

toHaveData(expected: unknown): this

Asserts that the data equals the expected value.

Parameters
  • expectedunknown
    • The expected data value
toHaveDataEqual(expected: unknown): this

Asserts that the data equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected data value
toHaveDataStrictEqual(expected: unknown): this

Asserts that the data strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected data value
toHaveDataSatisfying(matcher: (value: any) => unknown): this

Asserts that the data satisfies the provided matcher function.

Parameters
  • matcher(value: any) => unknown
    • A function that receives the data and performs assertions
toHaveDataMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the data matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveDataProperty(keyPath: string | string[], value?: unknown): this

Asserts that the data has the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value
toHaveDataPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the data property contains the specified value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The value to search for
toHaveDataPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the data property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveDataPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the data property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveDataPresent(): this

Asserts that the data is present (not null or undefined).

toHaveDataNull(): this

Asserts that the data is null.

toHaveDataUndefined(): this

Asserts that the data is undefined.

toHaveDataNullish(): this

Asserts that the data is nullish (null or undefined).

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#GraphqlResponseFailure

interface GraphqlResponseFailure<T = any> extends GraphqlResponseBase<T>

Failed GraphQL request (network error, HTTP error, etc.).

The request did not reach GraphQL processing.

NameDescription
processed
ok
error
extensionsResponse extensions (always null for failures).
statusHTTP status code (null for network failures).
headersHTTP response headers (null for failures).
rawNo raw response (request didn't reach server).
dataNo data (request didn't reach server).
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorGraphqlFailureError
  • readonlyextensionsnull

    Response extensions (always null for failures).

  • readonlystatusnull

    HTTP status code (null for network failures).

  • readonlyheadersnull

    HTTP response headers (null for failures).

  • readonlyrawnull

    No raw response (request didn't reach server).

  • readonlydatanull

    No data (request didn't reach server).

interface

#GraphqlResponseFailureParams

interface GraphqlResponseFailureParams

Parameters for creating a failure GraphqlResponse.

NameDescription
url
error
duration
Properties
interface

#GraphqlResponseSuccess

interface GraphqlResponseSuccess<T = any> extends GraphqlResponseBase<T>

Successful GraphQL response (no errors).

NameDescription
processed
ok
error
statusHTTP status code.
headersHTTP response headers.
extensionsResponse extensions.
rawRaw Web standard Response.
dataResponse data (null if no data).
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlystatusnumber

    HTTP status code.

  • readonlyheadersHeaders

    HTTP response headers.

  • readonlyextensionsRecord<string, unknown> | null

    Response extensions.

  • readonlyrawglobalThis.Response

    Raw Web standard Response.

  • readonlydataT | null

    Response data (null if no data).

interface

#GraphqlResponseSuccessParams

interface GraphqlResponseSuccessParams<T>

Parameters for creating a successful GraphqlResponse.

NameDescription
url
data
extensions
duration
status
raw
Properties
  • readonlyurlstring
  • readonlydataT | null
  • readonlyextensionsRecord<string, unknown> | null
  • readonlydurationnumber
  • readonlystatusnumber
  • readonlyrawglobalThis.Response
interface

#GrpcClientConfig

interface GrpcClientConfig extends Omit<ConnectRpcClientConfig, "protocol">

Configuration for creating a gRPC client.

This is a subset of ConnectRpcClientConfig with protocol fixed to "grpc".

interface

#GrpcResponseExpectation

interface GrpcResponseExpectation

Fluent expectation interface for gRPC responses.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the response is successful (code 0).
toHaveStatusCode()Asserts that the code equals the expected value.
toHaveStatusCodeEqual()Asserts that the code equals the expected value using deep equality.
toHaveStatusCodeStrictEqual()Asserts that the code strictly equals the expected value.
toHaveStatusCodeSatisfying()Asserts that the code satisfies the provided matcher function.
toHaveStatusCodeNaN()Asserts that the code is NaN.
toHaveStatusCodeGreaterThan()Asserts that the code is greater than the expected value.
toHaveStatusCodeGreaterThanOrEqual()Asserts that the code is greater than or equal to the expected value.
toHaveStatusCodeLessThan()Asserts that the code is less than the expected value.
toHaveStatusCodeLessThanOrEqual()Asserts that the code is less than or equal to the expected value.
toHaveStatusCodeCloseTo()Asserts that the code is close to the expected value.
toHaveStatusCodeOneOf()Asserts that the code is one of the specified values.
toHaveStatusMessage()Asserts that the message equals the expected value.
toHaveStatusMessageEqual()Asserts that the message equals the expected value using deep equality.
toHaveStatusMessageStrictEqual()Asserts that the message strictly equals the expected value.
toHaveStatusMessageSatisfying()Asserts that the message satisfies the provided matcher function.
toHaveStatusMessageContaining()Asserts that the message contains the specified substring.
toHaveStatusMessageMatching()Asserts that the message matches the specified regular expression.
toHaveStatusMessagePresent()Asserts that the message is present (not null or undefined).
toHaveStatusMessageNull()Asserts that the message is null.
toHaveStatusMessageUndefined()Asserts that the message is undefined.
toHaveStatusMessageNullish()Asserts that the message is nullish (null or undefined).
toHaveHeaders()Asserts that the headers equal the expected value.
toHaveHeadersEqual()Asserts that the headers equal the expected value using deep equality.
toHaveHeadersStrictEqual()Asserts that the headers strictly equal the expected value.
toHaveHeadersSatisfying()Asserts that the headers satisfy the provided matcher function.
toHaveHeadersMatching()Asserts that the headers match the specified subset.
toHaveHeadersProperty()Asserts that the headers have the specified property.
toHaveHeadersPropertyContaining()Asserts that the headers property contains the expected value.
toHaveHeadersPropertyMatching()Asserts that the headers property matches the specified subset.
toHaveHeadersPropertySatisfying()Asserts that the headers property satisfies the provided matcher function.
toHaveTrailers()Asserts that the trailers equal the expected value.
toHaveTrailersEqual()Asserts that the trailers equal the expected value using deep equality.
toHaveTrailersStrictEqual()Asserts that the trailers strictly equal the expected value.
toHaveTrailersSatisfying()Asserts that the trailers satisfy the provided matcher function.
toHaveTrailersMatching()Asserts that the trailers match the specified subset.
toHaveTrailersProperty()Asserts that the trailers have the specified property.
toHaveTrailersPropertyContaining()Asserts that the trailers property contains the expected value.
toHaveTrailersPropertyMatching()Asserts that the trailers property matches the specified subset.
toHaveTrailersPropertySatisfying()Asserts that the trailers property satisfies the provided matcher function.
toHaveData()Asserts that the data equals the expected value.
toHaveDataEqual()Asserts that the data equals the expected value using deep equality.
toHaveDataStrictEqual()Asserts that the data strictly equals the expected value.
toHaveDataSatisfying()Asserts that the data satisfies the provided matcher function.
toHaveDataPresent()Asserts that the data is present (not null or undefined).
toHaveDataNull()Asserts that the data is null.
toHaveDataUndefined()Asserts that the data is undefined.
toHaveDataNullish()Asserts that the data is nullish (null or undefined).
toHaveDataMatching()Asserts that the data matches the specified subset.
toHaveDataProperty()Asserts that the data has the specified property.
toHaveDataPropertyContaining()Asserts that the data property contains the expected value.
toHaveDataPropertyMatching()Asserts that the data property matches the specified subset.
toHaveDataPropertySatisfying()Asserts that the data property satisfies the provided matcher function.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the response is successful (code 0).

toHaveStatusCode(expected: unknown): this

Asserts that the code equals the expected value.

Parameters
  • expectedunknown
    • The expected code value
toHaveStatusCodeEqual(expected: unknown): this

Asserts that the code equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected code value
toHaveStatusCodeStrictEqual(expected: unknown): this

Asserts that the code strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected code value
toHaveStatusCodeSatisfying(matcher: (value: GrpcStatusCode) => unknown): this

Asserts that the code satisfies the provided matcher function.

Parameters
  • matcher(value: GrpcStatusCode) => unknown
    • A function that receives the code and performs assertions
toHaveStatusCodeNaN(): this

Asserts that the code is NaN.

toHaveStatusCodeGreaterThan(expected: number): this

Asserts that the code is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusCodeGreaterThanOrEqual(expected: number): this

Asserts that the code is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusCodeLessThan(expected: number): this

Asserts that the code is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusCodeLessThanOrEqual(expected: number): this

Asserts that the code is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusCodeCloseTo(expected: number, numDigits?: number): this

Asserts that the code is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveStatusCodeOneOf(values: unknown[]): this

Asserts that the code is one of the specified values.

Parameters
  • valuesunknown[]
    • Array of acceptable values
toHaveStatusMessage(expected: unknown): this

Asserts that the message equals the expected value.

Parameters
  • expectedunknown
    • The expected message value
toHaveStatusMessageEqual(expected: unknown): this

Asserts that the message equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected message value
toHaveStatusMessageStrictEqual(expected: unknown): this

Asserts that the message strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected message value
toHaveStatusMessageSatisfying(matcher: (value: string) => unknown): this

Asserts that the message satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the message and performs assertions
toHaveStatusMessageContaining(substr: string): this

Asserts that the message contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveStatusMessageMatching(expected: RegExp): this

Asserts that the message matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveStatusMessagePresent(): this

Asserts that the message is present (not null or undefined).

toHaveStatusMessageNull(): this

Asserts that the message is null.

toHaveStatusMessageUndefined(): this

Asserts that the message is undefined.

toHaveStatusMessageNullish(): this

Asserts that the message is nullish (null or undefined).

toHaveHeaders(expected: unknown): this

Asserts that the headers equal the expected value.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersEqual(expected: unknown): this

Asserts that the headers equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersStrictEqual(expected: unknown): this

Asserts that the headers strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersSatisfying(matcher: (value: GrpcHeaders) => unknown): this

Asserts that the headers satisfy the provided matcher function.

Parameters
  • matcher(value: GrpcHeaders) => unknown
    • A function that receives the headers and performs assertions
toHaveHeadersMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the headers match the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveHeadersProperty(keyPath: string | string[], value?: unknown): this

Asserts that the headers have the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveHeadersPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the headers property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveHeadersPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the headers property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveHeadersPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the headers property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveTrailers(expected: unknown): this

Asserts that the trailers equal the expected value.

Parameters
  • expectedunknown
    • The expected trailers value
toHaveTrailersEqual(expected: unknown): this

Asserts that the trailers equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected trailers value
toHaveTrailersStrictEqual(expected: unknown): this

Asserts that the trailers strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected trailers value
toHaveTrailersSatisfying(matcher: (value: GrpcTrailers) => unknown): this

Asserts that the trailers satisfy the provided matcher function.

Parameters
  • matcher(value: GrpcTrailers) => unknown
    • A function that receives the trailers and performs assertions
toHaveTrailersMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the trailers match the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveTrailersProperty(keyPath: string | string[], value?: unknown): this

Asserts that the trailers have the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveTrailersPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the trailers property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveTrailersPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the trailers property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveTrailersPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the trailers property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveData(expected: unknown): this

Asserts that the data equals the expected value.

Parameters
  • expectedunknown
    • The expected data value
toHaveDataEqual(expected: unknown): this

Asserts that the data equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected data value
toHaveDataStrictEqual(expected: unknown): this

Asserts that the data strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected data value
toHaveDataSatisfying(
  matcher: (value: Record<string, any> | null) => unknown,
): this

Asserts that the data satisfies the provided matcher function.

Parameters
  • matcher(value: Record<string, any> | null) => unknown
    • A function that receives the data and performs assertions
toHaveDataPresent(): this

Asserts that the data is present (not null or undefined).

toHaveDataNull(): this

Asserts that the data is null.

toHaveDataUndefined(): this

Asserts that the data is undefined.

toHaveDataNullish(): this

Asserts that the data is nullish (null or undefined).

toHaveDataMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the data matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveDataProperty(keyPath: string | string[], value?: unknown): this

Asserts that the data has the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveDataPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the data property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveDataPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the data property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveDataPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the data property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#HttpClient

interface HttpClient extends AsyncDisposable

HTTP client interface.

NameDescription
configClient configuration
get()Send GET request
head()Send HEAD request
post()Send POST request
put()Send PUT request
patch()Send PATCH request
delete()Send DELETE request
options()Send OPTIONS request
request()Send request with arbitrary method
getCookies()Get all cookies in the cookie jar.
setCookie()Set a cookie in the cookie jar.
clearCookies()Clear all cookies from the cookie jar.
close()Close the client and release resources
Properties
Methods
get(path: string, options?: HttpOptions): Promise<HttpResponse>

Send GET request

Parameters
head(path: string, options?: HttpOptions): Promise<HttpResponse>

Send HEAD request

Parameters
post(path: string, options?: HttpRequestOptions): Promise<HttpResponse>

Send POST request

Parameters
put(path: string, options?: HttpRequestOptions): Promise<HttpResponse>

Send PUT request

Parameters
patch(path: string, options?: HttpRequestOptions): Promise<HttpResponse>

Send PATCH request

Parameters
delete(path: string, options?: HttpRequestOptions): Promise<HttpResponse>

Send DELETE request

Parameters
options(path: string, options?: HttpOptions): Promise<HttpResponse>

Send OPTIONS request

Parameters
request(
  method: string,
  path: string,
  options?: HttpRequestOptions,
): Promise<HttpResponse>

Send request with arbitrary method

Parameters
getCookies(): Record<string, string>

Get all cookies in the cookie jar. Returns empty object if cookies are disabled.

setCookie(name: string, value: string): void

Set a cookie in the cookie jar.

Parameters
  • namestring
  • valuestring
clearCookies(): void

Clear all cookies from the cookie jar. No-op if cookies are disabled.

close(): Promise<void>

Close the client and release resources

interface

#HttpClientConfig

interface HttpClientConfig extends CommonOptions

HTTP client configuration.

NameDescription
urlBase URL for all requests.
headersDefault headers for all requests
fetchCustom fetch implementation (for testing/mocking)
redirectDefault redirect handling mode.
throwOnErrorWhether to throw HttpError for non-2xx responses.
cookiesCookie handling configuration.
Properties
  • readonlyurlstring | HttpConnectionConfig

    Base URL for all requests.

    Can be a URL string or a connection configuration object.

  • readonlyheaders?HeadersInit

    Default headers for all requests

  • readonlyfetch?fetch

    Custom fetch implementation (for testing/mocking)

  • readonlyredirect?RedirectMode

    Default redirect handling mode. Can be overridden per-request via HttpOptions.

  • readonlythrowOnError?boolean

    Whether to throw HttpError for non-2xx responses. Can be overridden per-request via HttpOptions.

  • readonlycookies?CookieConfig

    Cookie handling configuration. By default, the client maintains a cookie jar for automatic cookie management across requests. Set cookies: { disabled: true } to disable.

interface

#HttpConnectionConfig

interface HttpConnectionConfig extends CommonConnectionConfig

HTTP connection configuration.

Extends CommonConnectionConfig with HTTP-specific options.

NameDescription
protocolProtocol to use.
pathBase path prefix for all requests.
Properties
  • readonlyprotocol?"http" | "https"

    Protocol to use.

  • readonlypath?string

    Base path prefix for all requests.

interface

#HttpErrorOptions

interface HttpErrorOptions extends ErrorOptions

Options for creating an HttpError.

NameDescription
bodyResponse body as raw bytes
headersResponse headers
Properties
  • readonlybody?Uint8Array | null

    Response body as raw bytes

  • readonlyheaders?Headers | null

    Response headers

interface

#HttpOptions

interface HttpOptions extends CommonOptions

Options for individual HTTP requests.

NameDescription
queryQuery parameters (arrays for multi-value params)
headersAdditional request headers
redirectRedirect handling mode.
throwOnErrorWhether to throw HttpError for non-2xx responses.
Properties
  • readonlyquery?QueryParams

    Query parameters (arrays for multi-value params)

  • readonlyheaders?HeadersInit

    Additional request headers

  • readonlyredirect?RedirectMode

    Redirect handling mode.

  • readonlythrowOnError?boolean

    Whether to throw HttpError for non-2xx responses. When false, non-2xx responses are returned as HttpResponse.

interface

#HttpRequestOptions

interface HttpRequestOptions extends HttpOptions

Options for HTTP requests that may include a body.

NameDescription
bodyRequest body
Properties
interface

#HttpResponseError

interface HttpResponseError<T = any> extends HttpResponseBase<T>

HTTP response for error responses (4xx/5xx status codes).

Server received and processed the request, but returned an error status.

NameDescription
processedServer processed the request.
okResponse was not successful (4xx/5xx).
errorError describing the HTTP error.
statusHTTP status code (4xx/5xx).
statusTextHTTP status text.
headersResponse headers.
rawRaw Web standard Response.
Properties
  • readonlyprocessedtrue

    Server processed the request.

  • readonlyokfalse

    Response was not successful (4xx/5xx).

  • readonlyerrorHttpError

    Error describing the HTTP error.

  • readonlystatusnumber

    HTTP status code (4xx/5xx).

  • readonlystatusTextstring

    HTTP status text.

  • readonlyheadersHeaders

    Response headers.

  • readonlyrawglobalThis.Response

    Raw Web standard Response.

interface

#HttpResponseExpectation

interface HttpResponseExpectation

Fluent API for HTTP response validation.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the response is successful (status 2xx).
toHaveStatus()Asserts that the status equals the expected value.
toHaveStatusEqual()Asserts that the status equals the expected value using deep equality.
toHaveStatusStrictEqual()Asserts that the status strictly equals the expected value.
toHaveStatusSatisfying()Asserts that the status satisfies the provided matcher function.
toHaveStatusNaN()Asserts that the status is NaN.
toHaveStatusGreaterThan()Asserts that the status is greater than the expected value.
toHaveStatusGreaterThanOrEqual()Asserts that the status is greater than or equal to the expected value.
toHaveStatusLessThan()Asserts that the status is less than the expected value.
toHaveStatusLessThanOrEqual()Asserts that the status is less than or equal to the expected value.
toHaveStatusCloseTo()Asserts that the status is close to the expected value.
toHaveStatusOneOf()Asserts that the status is one of the specified values.
toHaveStatusText()Asserts that the status text equals the expected value.
toHaveStatusTextEqual()Asserts that the status text equals the expected value using deep equality.
toHaveStatusTextStrictEqual()Asserts that the status text strictly equals the expected value.
toHaveStatusTextSatisfying()Asserts that the status text satisfies the provided matcher function.
toHaveStatusTextContaining()Asserts that the status text contains the specified substring.
toHaveStatusTextMatching()Asserts that the status text matches the specified regular expression.
toHaveHeaders()Asserts that the headers equal the expected value.
toHaveHeadersEqual()Asserts that the headers equal the expected value using deep equality.
toHaveHeadersStrictEqual()Asserts that the headers strictly equal the expected value.
toHaveHeadersSatisfying()Asserts that the headers satisfy the provided matcher function.
toHaveHeadersMatching()Asserts that the headers match the specified subset.
toHaveHeadersProperty()Asserts that the headers have the specified property.
toHaveHeadersPropertyContaining()Asserts that the headers property contains the expected value.
toHaveHeadersPropertyMatching()Asserts that the headers property matches the specified subset.
toHaveHeadersPropertySatisfying()Asserts that the headers property satisfies the provided matcher function.
toHaveUrl()Asserts that the URL equals the expected value.
toHaveUrlEqual()Asserts that the URL equals the expected value using deep equality.
toHaveUrlStrictEqual()Asserts that the URL strictly equals the expected value.
toHaveUrlSatisfying()Asserts that the URL satisfies the provided matcher function.
toHaveUrlContaining()Asserts that the URL contains the specified substring.
toHaveUrlMatching()Asserts that the URL matches the specified regular expression.
toHaveBody()Asserts that the body equals the expected value.
toHaveBodyEqual()Asserts that the body equals the expected value using deep equality.
toHaveBodyStrictEqual()Asserts that the body strictly equals the expected value.
toHaveBodySatisfying()Asserts that the body satisfies the provided matcher function.
toHaveBodyPresent()Asserts that the body is present (not null or undefined).
toHaveBodyNull()Asserts that the body is null.
toHaveBodyUndefined()Asserts that the body is undefined.
toHaveBodyNullish()Asserts that the body is nullish (null or undefined).
toHaveBodyLength()Asserts that the body length equals the expected value.
toHaveBodyLengthEqual()Asserts that the body length equals the expected value using deep equality.
toHaveBodyLengthStrictEqual()Asserts that the body length strictly equals the expected value.
toHaveBodyLengthSatisfying()Asserts that the body length satisfies the provided matcher function.
toHaveBodyLengthNaN()Asserts that the body length is NaN.
toHaveBodyLengthGreaterThan()Asserts that the body length is greater than the expected value.
toHaveBodyLengthGreaterThanOrEqual()Asserts that the body length is greater than or equal to the expected value.
toHaveBodyLengthLessThan()Asserts that the body length is less than the expected value.
toHaveBodyLengthLessThanOrEqual()Asserts that the body length is less than or equal to the expected value.
toHaveBodyLengthCloseTo()Asserts that the body length is close to the expected value.
toHaveText()Asserts that the text equals the expected value.
toHaveTextEqual()Asserts that the text equals the expected value using deep equality.
toHaveTextStrictEqual()Asserts that the text strictly equals the expected value.
toHaveTextSatisfying()Asserts that the text satisfies the provided matcher function.
toHaveTextContaining()Asserts that the text contains the specified substring.
toHaveTextMatching()Asserts that the text matches the specified regular expression.
toHaveTextPresent()Asserts that the text is present (not null or undefined).
toHaveTextNull()Asserts that the text is null.
toHaveTextUndefined()Asserts that the text is undefined.
toHaveTextNullish()Asserts that the text is nullish (null or undefined).
toHaveTextLength()Asserts that the text length equals the expected value.
toHaveTextLengthEqual()Asserts that the text length equals the expected value using deep equality.
toHaveTextLengthStrictEqual()Asserts that the text length strictly equals the expected value.
toHaveTextLengthSatisfying()Asserts that the text length satisfies the provided matcher function.
toHaveTextLengthNaN()Asserts that the text length is NaN.
toHaveTextLengthGreaterThan()Asserts that the text length is greater than the expected value.
toHaveTextLengthGreaterThanOrEqual()Asserts that the text length is greater than or equal to the expected value.
toHaveTextLengthLessThan()Asserts that the text length is less than the expected value.
toHaveTextLengthLessThanOrEqual()Asserts that the text length is less than or equal to the expected value.
toHaveTextLengthCloseTo()Asserts that the text length is close to the expected value.
toHaveJson()Asserts that the JSON equals the expected value.
toHaveJsonEqual()Asserts that the JSON equals the expected value using deep equality.
toHaveJsonStrictEqual()Asserts that the JSON strictly equals the expected value.
toHaveJsonSatisfying()Asserts that the JSON satisfies the provided matcher function.
toHaveJsonPresent()Asserts that the JSON is present (not null or undefined).
toHaveJsonNull()Asserts that the JSON is null.
toHaveJsonUndefined()Asserts that the JSON is undefined.
toHaveJsonNullish()Asserts that the JSON is nullish (null or undefined).
toHaveJsonMatching()Asserts that the JSON matches the specified subset.
toHaveJsonProperty()Asserts that the JSON has the specified property.
toHaveJsonPropertyContaining()Asserts that the JSON property contains the expected value.
toHaveJsonPropertyMatching()Asserts that the JSON property matches the specified subset.
toHaveJsonPropertySatisfying()Asserts that the JSON property satisfies the provided matcher function.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the response is successful (status 2xx).

toHaveStatus(expected: unknown): this

Asserts that the status equals the expected value.

Parameters
  • expectedunknown
    • The expected status value
toHaveStatusEqual(expected: unknown): this

Asserts that the status equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected status value
toHaveStatusStrictEqual(expected: unknown): this

Asserts that the status strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected status value
toHaveStatusSatisfying(matcher: (value: number) => unknown): this

Asserts that the status satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the status and performs assertions
toHaveStatusNaN(): this

Asserts that the status is NaN.

toHaveStatusGreaterThan(expected: number): this

Asserts that the status is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusGreaterThanOrEqual(expected: number): this

Asserts that the status is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusLessThan(expected: number): this

Asserts that the status is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusLessThanOrEqual(expected: number): this

Asserts that the status is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveStatusCloseTo(expected: number, numDigits?: number): this

Asserts that the status is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveStatusOneOf(values: unknown[]): this

Asserts that the status is one of the specified values.

Parameters
  • valuesunknown[]
    • Array of acceptable values
toHaveStatusText(expected: unknown): this

Asserts that the status text equals the expected value.

Parameters
  • expectedunknown
    • The expected status text
toHaveStatusTextEqual(expected: unknown): this

Asserts that the status text equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected status text
toHaveStatusTextStrictEqual(expected: unknown): this

Asserts that the status text strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected status text
toHaveStatusTextSatisfying(matcher: (value: string) => unknown): this

Asserts that the status text satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the status text and performs assertions
toHaveStatusTextContaining(substr: string): this

Asserts that the status text contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveStatusTextMatching(expected: RegExp): this

Asserts that the status text matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveHeaders(expected: unknown): this

Asserts that the headers equal the expected value.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersEqual(expected: unknown): this

Asserts that the headers equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersStrictEqual(expected: unknown): this

Asserts that the headers strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected headers value
toHaveHeadersSatisfying(matcher: (value: HttpHeaders) => unknown): this

Asserts that the headers satisfy the provided matcher function.

Parameters
  • matcher(value: HttpHeaders) => unknown
    • A function that receives the headers and performs assertions
toHaveHeadersMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the headers match the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveHeadersProperty(keyPath: string | string[], value?: unknown): this

Asserts that the headers have the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveHeadersPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the headers property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveHeadersPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the headers property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveHeadersPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the headers property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveUrl(expected: unknown): this

Asserts that the URL equals the expected value.

Parameters
  • expectedunknown
    • The expected URL value
toHaveUrlEqual(expected: unknown): this

Asserts that the URL equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected URL value
toHaveUrlStrictEqual(expected: unknown): this

Asserts that the URL strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected URL value
toHaveUrlSatisfying(matcher: (value: string) => unknown): this

Asserts that the URL satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the URL and performs assertions
toHaveUrlContaining(substr: string): this

Asserts that the URL contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveUrlMatching(expected: RegExp): this

Asserts that the URL matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveBody(expected: unknown): this

Asserts that the body equals the expected value.

Parameters
  • expectedunknown
    • The expected body value
toHaveBodyEqual(expected: unknown): this

Asserts that the body equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected body value
toHaveBodyStrictEqual(expected: unknown): this

Asserts that the body strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected body value
toHaveBodySatisfying(matcher: (value: Uint8Array | null) => unknown): this

Asserts that the body satisfies the provided matcher function.

Parameters
  • matcher(value: Uint8Array | null) => unknown
    • A function that receives the body and performs assertions
toHaveBodyPresent(): this

Asserts that the body is present (not null or undefined).

toHaveBodyNull(): this

Asserts that the body is null.

toHaveBodyUndefined(): this

Asserts that the body is undefined.

toHaveBodyNullish(): this

Asserts that the body is nullish (null or undefined).

toHaveBodyLength(expected: unknown): this

Asserts that the body length equals the expected value.

Parameters
  • expectedunknown
    • The expected body length
toHaveBodyLengthEqual(expected: unknown): this

Asserts that the body length equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected body length
toHaveBodyLengthStrictEqual(expected: unknown): this

Asserts that the body length strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected body length
toHaveBodyLengthSatisfying(matcher: (value: number) => unknown): this

Asserts that the body length satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the body length and performs assertions
toHaveBodyLengthNaN(): this

Asserts that the body length is NaN.

toHaveBodyLengthGreaterThan(expected: number): this

Asserts that the body length is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveBodyLengthGreaterThanOrEqual(expected: number): this

Asserts that the body length is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveBodyLengthLessThan(expected: number): this

Asserts that the body length is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveBodyLengthLessThanOrEqual(expected: number): this

Asserts that the body length is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveBodyLengthCloseTo(expected: number, numDigits?: number): this

Asserts that the body length is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveText(expected: unknown): this

Asserts that the text equals the expected value.

Parameters
  • expectedunknown
    • The expected text value
toHaveTextEqual(expected: unknown): this

Asserts that the text equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected text value
toHaveTextStrictEqual(expected: unknown): this

Asserts that the text strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected text value
toHaveTextSatisfying(matcher: (value: string) => unknown): this

Asserts that the text satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the text and performs assertions
toHaveTextContaining(substr: string): this

Asserts that the text contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveTextMatching(expected: RegExp): this

Asserts that the text matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveTextPresent(): this

Asserts that the text is present (not null or undefined).

toHaveTextNull(): this

Asserts that the text is null.

toHaveTextUndefined(): this

Asserts that the text is undefined.

toHaveTextNullish(): this

Asserts that the text is nullish (null or undefined).

toHaveTextLength(expected: unknown): this

Asserts that the text length equals the expected value.

Parameters
  • expectedunknown
    • The expected text length
toHaveTextLengthEqual(expected: unknown): this

Asserts that the text length equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected text length
toHaveTextLengthStrictEqual(expected: unknown): this

Asserts that the text length strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected text length
toHaveTextLengthSatisfying(matcher: (value: number) => unknown): this

Asserts that the text length satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the text length and performs assertions
toHaveTextLengthNaN(): this

Asserts that the text length is NaN.

toHaveTextLengthGreaterThan(expected: number): this

Asserts that the text length is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveTextLengthGreaterThanOrEqual(expected: number): this

Asserts that the text length is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveTextLengthLessThan(expected: number): this

Asserts that the text length is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveTextLengthLessThanOrEqual(expected: number): this

Asserts that the text length is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveTextLengthCloseTo(expected: number, numDigits?: number): this

Asserts that the text length is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveJson(expected: unknown): this

Asserts that the JSON equals the expected value.

Parameters
  • expectedunknown
    • The expected JSON value
toHaveJsonEqual(expected: unknown): this

Asserts that the JSON equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected JSON value
toHaveJsonStrictEqual(expected: unknown): this

Asserts that the JSON strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected JSON value
toHaveJsonSatisfying(
  matcher: (value: Record<string, any> | null) => unknown,
): this

Asserts that the JSON satisfies the provided matcher function.

Parameters
  • matcher(value: Record<string, any> | null) => unknown
    • A function that receives the JSON and performs assertions
toHaveJsonPresent(): this

Asserts that the JSON is present (not null or undefined).

toHaveJsonNull(): this

Asserts that the JSON is null.

toHaveJsonUndefined(): this

Asserts that the JSON is undefined.

toHaveJsonNullish(): this

Asserts that the JSON is nullish (null or undefined).

toHaveJsonMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the JSON matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveJsonProperty(keyPath: string | string[], value?: unknown): this

Asserts that the JSON has the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveJsonPropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the JSON property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveJsonPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the JSON property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveJsonPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the JSON property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#HttpResponseFailure

interface HttpResponseFailure<T = any> extends HttpResponseBase<T>

HTTP response for request failures (network errors, timeouts, etc.).

Request could not be processed by the server (network error, DNS failure, connection refused, timeout, aborted, etc.).

NameDescription
processedServer did not process the request.
okRequest failed.
errorError describing the failure (ConnectionError, TimeoutError, AbortError).
statusNo HTTP status (request didn't reach server).
statusTextNo HTTP status text (request didn't reach server).
headersNo headers (request didn't reach server).
bodyNo body (request didn't reach server).
rawNo raw response (request didn't reach server).
Properties
  • readonlyprocessedfalse

    Server did not process the request.

  • readonlyokfalse

    Request failed.

  • readonlyerrorHttpFailureError

    Error describing the failure (ConnectionError, TimeoutError, AbortError).

  • readonlystatusnull

    No HTTP status (request didn't reach server).

  • readonlystatusTextnull

    No HTTP status text (request didn't reach server).

  • readonlyheadersnull

    No headers (request didn't reach server).

  • readonlybodynull

    No body (request didn't reach server).

  • readonlyrawnull

    No raw response (request didn't reach server).

interface

#HttpResponseSuccess

interface HttpResponseSuccess<T = any> extends HttpResponseBase<T>

HTTP response for successful requests (2xx status codes).

Wraps Web standard Response, allowing body to be read synchronously and multiple times (unlike the streaming-based standard Response).

NameDescription
processedServer processed the request.
okResponse was successful (2xx).
errorNo error for successful responses.
statusHTTP status code (200-299).
statusTextHTTP status text.
headersResponse headers.
rawRaw Web standard Response.
Properties
  • readonlyprocessedtrue

    Server processed the request.

  • readonlyoktrue

    Response was successful (2xx).

  • readonlyerrornull

    No error for successful responses.

  • readonlystatusnumber

    HTTP status code (200-299).

  • readonlystatusTextstring

    HTTP status text.

  • readonlyheadersHeaders

    Response headers.

  • readonlyrawglobalThis.Response

    Raw Web standard Response.

interface

#MethodInfo

interface MethodInfo

Method information from reflection.

NameDescription
nameMethod name (e.g., "Echo")
localNameLocal name (camelCase)
kindMethod kind
inputTypeInput message type name
outputTypeOutput message type name
idempotentWhether the method is idempotent
Properties
  • readonlynamestring

    Method name (e.g., "Echo")

  • readonlylocalNamestring

    Local name (camelCase)

  • readonlykind"unary" | "server_streaming" | "client_streaming" | "bidi_streaming"

    Method kind

  • readonlyinputTypestring

    Input message type name

  • readonlyoutputTypestring

    Output message type name

  • readonlyidempotentboolean

    Whether the method is idempotent

interface

#MongoClient

interface MongoClient extends AsyncDisposable

MongoDB client interface

NameDescription
config
collection()
db()
transaction()
close()
Properties
Methods
collection<T extends Document = Document>(name: string): MongoCollection<T>
Parameters
  • namestring
db(name: string): MongoClient
Parameters
  • namestring
transaction<T>(fn: (session: MongoSession) => unknown): Promise<T>
Parameters
close(): Promise<void>
interface

#MongoClientConfig

interface MongoClientConfig extends MongoOptions

MongoDB client configuration.

Examples

Using a connection string

const config: MongoClientConfig = {
  url: "mongodb://localhost:27017",
  database: "testdb",
};

Using a configuration object

const config: MongoClientConfig = {
  url: {
    host: "localhost",
    port: 27017,
    username: "admin",
    password: "secret",
    authSource: "admin",
  },
  database: "testdb",
};
NameDescription
urlMongoDB connection URL or configuration object.
databaseDatabase name to connect to.
Properties
  • readonlyurlstring | MongoConnectionConfig

    MongoDB connection URL or configuration object.

  • readonlydatabasestring

    Database name to connect to.

interface

#MongoCollection

interface MongoCollection<T extends Document>

MongoDB collection interface

Methods
find(filter?: Filter, options?: MongoFindOptions): Promise<MongoFindResult<T>>
Parameters
findOne(filter: Filter, options?: MongoOptions): Promise<MongoFindOneResult<T>>
Parameters
insertOne(
  doc: Omit<T, "_id">,
  options?: MongoOptions,
): Promise<MongoInsertOneResult>
Parameters
insertMany(
  docs: Omit<T, "_id">[],
  options?: MongoOptions,
): Promise<MongoInsertManyResult>
Parameters
updateOne(
  filter: Filter,
  update: UpdateFilter,
  options?: MongoUpdateOptions,
): Promise<MongoUpdateResult>
Parameters
updateMany(
  filter: Filter,
  update: UpdateFilter,
  options?: MongoUpdateOptions,
): Promise<MongoUpdateResult>
Parameters
deleteOne(filter: Filter, options?: MongoOptions): Promise<MongoDeleteResult>
Parameters
deleteMany(filter: Filter, options?: MongoOptions): Promise<MongoDeleteResult>
Parameters
aggregate<R = T>(
  pipeline: Document[],
  options?: MongoOptions,
): Promise<MongoFindResult<R>>
Parameters
countDocuments(
  filter?: Filter,
  options?: MongoOptions,
): Promise<MongoCountResult>
Parameters
interface

#MongoConnectionConfig

interface MongoConnectionConfig extends CommonConnectionConfig

MongoDB connection configuration.

Extends CommonConnectionConfig with MongoDB-specific options.

NameDescription
databaseDatabase name to connect to.
authSourceAuthentication database.
replicaSetReplica set name.
Properties
  • readonlydatabase?string

    Database name to connect to.

  • readonlyauthSource?string

    Authentication database.

  • readonlyreplicaSet?string

    Replica set name.

interface

#MongoCountResultError

interface MongoCountResultError extends MongoCountResultBase

Count result with MongoDB error.

NameDescription
processed
ok
error
count
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorMongoError
  • readonlycountnull
interface

#MongoCountResultExpectation

interface MongoCountResultExpectation

Fluent API for MongoDB count result validation.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the count result is successful.
toHaveCount()Asserts that the count equals the expected value.
toHaveCountEqual()Asserts that the count equals the expected value using deep equality.
toHaveCountStrictEqual()Asserts that the count strictly equals the expected value.
toHaveCountSatisfying()Asserts that the count satisfies the provided matcher function.
toHaveCountNaN()Asserts that the count is NaN.
toHaveCountGreaterThan()Asserts that the count is greater than the expected value.
toHaveCountGreaterThanOrEqual()Asserts that the count is greater than or equal to the expected value.
toHaveCountLessThan()Asserts that the count is less than the expected value.
toHaveCountLessThanOrEqual()Asserts that the count is less than or equal to the expected value.
toHaveCountCloseTo()Asserts that the count is close to the expected value.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the count result is successful.

toHaveCount(expected: unknown): this

Asserts that the count equals the expected value.

Parameters
  • expectedunknown
    • The expected count
toHaveCountEqual(expected: unknown): this

Asserts that the count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected count
toHaveCountStrictEqual(expected: unknown): this

Asserts that the count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected count
toHaveCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the count and performs assertions
toHaveCountNaN(): this

Asserts that the count is NaN.

toHaveCountGreaterThan(expected: number): this

Asserts that the count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveCountGreaterThanOrEqual(expected: number): this

Asserts that the count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveCountLessThan(expected: number): this

Asserts that the count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveCountLessThanOrEqual(expected: number): this

Asserts that the count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveCountCloseTo(expected: number, numDigits?: number): this

Asserts that the count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#MongoCountResultFailure

interface MongoCountResultFailure extends MongoCountResultBase

Count result with connection failure.

NameDescription
processed
ok
error
count
Properties
interface

#MongoCountResultSuccess

interface MongoCountResultSuccess extends MongoCountResultBase

Successful count result.

NameDescription
processed
ok
error
count
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlycountnumber
interface

#MongoDeleteResultError

interface MongoDeleteResultError extends MongoDeleteResultBase

Delete result with MongoDB error.

NameDescription
processed
ok
error
deletedCount
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorMongoError
  • readonlydeletedCountnull
interface

#MongoDeleteResultExpectation

interface MongoDeleteResultExpectation

Fluent API for MongoDB delete result validation.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the delete result is successful.
toHaveDeletedCount()Asserts that the deleted count equals the expected value.
toHaveDeletedCountEqual()Asserts that the deleted count equals the expected value using deep equality.
toHaveDeletedCountStrictEqual()Asserts that the deleted count strictly equals the expected value.
toHaveDeletedCountSatisfying()Asserts that the deleted count satisfies the provided matcher function.
toHaveDeletedCountNaN()Asserts that the deleted count is NaN.
toHaveDeletedCountGreaterThan()Asserts that the deleted count is greater than the expected value.
toHaveDeletedCountGreaterThanOrEqual()Asserts that the deleted count is greater than or equal to the expected value.
toHaveDeletedCountLessThan()Asserts that the deleted count is less than the expected value.
toHaveDeletedCountLessThanOrEqual()Asserts that the deleted count is less than or equal to the expected value.
toHaveDeletedCountCloseTo()Asserts that the deleted count is close to the expected value.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the delete result is successful.

toHaveDeletedCount(expected: unknown): this

Asserts that the deleted count equals the expected value.

Parameters
  • expectedunknown
    • The expected deleted count
toHaveDeletedCountEqual(expected: unknown): this

Asserts that the deleted count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected deleted count
toHaveDeletedCountStrictEqual(expected: unknown): this

Asserts that the deleted count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected deleted count
toHaveDeletedCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the deleted count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the deleted count and performs assertions
toHaveDeletedCountNaN(): this

Asserts that the deleted count is NaN.

toHaveDeletedCountGreaterThan(expected: number): this

Asserts that the deleted count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDeletedCountGreaterThanOrEqual(expected: number): this

Asserts that the deleted count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDeletedCountLessThan(expected: number): this

Asserts that the deleted count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDeletedCountLessThanOrEqual(expected: number): this

Asserts that the deleted count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDeletedCountCloseTo(expected: number, numDigits?: number): this

Asserts that the deleted count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#MongoDeleteResultFailure

interface MongoDeleteResultFailure extends MongoDeleteResultBase

Delete result with connection failure.

NameDescription
processed
ok
error
deletedCount
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorMongoFailureError
  • readonlydeletedCountnull
interface

#MongoDeleteResultSuccess

interface MongoDeleteResultSuccess extends MongoDeleteResultBase

Successful delete result.

NameDescription
processed
ok
error
deletedCount
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlydeletedCountnumber
interface

#MongoErrorOptions

interface MongoErrorOptions extends ErrorOptions

Options for MongoDB errors.

NameDescription
code
Properties
  • readonlycode?number
interface

#MongoFindOneResultError

interface MongoFindOneResultError<T = Document> extends MongoFindOneResultBase<T>

FindOne result with MongoDB error.

NameDescription
processed
ok
error
doc
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorMongoError
  • readonlydocnull
interface

#MongoFindOneResultExpectation

interface MongoFindOneResultExpectation<_T = unknown>

Fluent API for MongoDB findOne result validation.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the findOne result is successful.
toHaveDoc()Asserts that the doc equals the expected value.
toHaveDocEqual()Asserts that the doc equals the expected value using deep equality.
toHaveDocStrictEqual()Asserts that the doc strictly equals the expected value.
toHaveDocSatisfying()Asserts that the doc satisfies the provided matcher function.
toHaveDocPresent()Asserts that the doc is present (not null or undefined).
toHaveDocNull()Asserts that the doc is null.
toHaveDocUndefined()Asserts that the doc is undefined.
toHaveDocNullish()Asserts that the doc is nullish (null or undefined).
toHaveDocMatching()Asserts that the doc matches the specified subset.
toHaveDocProperty()Asserts that the doc has the specified property.
toHaveDocPropertyContaining()Asserts that the doc property contains the expected value.
toHaveDocPropertyMatching()Asserts that the doc property matches the specified subset.
toHaveDocPropertySatisfying()Asserts that the doc property satisfies the provided matcher function.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the findOne result is successful.

toHaveDoc(expected: unknown): this

Asserts that the doc equals the expected value.

Parameters
  • expectedunknown
    • The expected doc value
toHaveDocEqual(expected: unknown): this

Asserts that the doc equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected doc value
toHaveDocStrictEqual(expected: unknown): this

Asserts that the doc strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected doc value
toHaveDocSatisfying(matcher: (value: MongoFindOneDoc<_T>) => unknown): this

Asserts that the doc satisfies the provided matcher function.

Parameters
  • matcher(value: MongoFindOneDoc<_T>) => unknown
    • A function that receives the doc and performs assertions
toHaveDocPresent(): this

Asserts that the doc is present (not null or undefined).

toHaveDocNull(): this

Asserts that the doc is null.

toHaveDocUndefined(): this

Asserts that the doc is undefined.

toHaveDocNullish(): this

Asserts that the doc is nullish (null or undefined).

toHaveDocMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the doc matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveDocProperty(keyPath: string | string[], value?: unknown): this

Asserts that the doc has the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveDocPropertyContaining(keyPath: string | string[], expected: unknown): this

Asserts that the doc property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveDocPropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the doc property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveDocPropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the doc property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#MongoFindOneResultFailure

interface MongoFindOneResultFailure<T = Document> extends MongoFindOneResultBase<T>

FindOne result with connection failure.

NameDescription
processed
ok
error
doc
Properties
interface

#MongoFindOneResultSuccess

interface MongoFindOneResultSuccess<T = Document> extends MongoFindOneResultBase<T>

Successful findOne result.

NameDescription
processed
ok
error
doc
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlydocT | null
interface

#MongoFindOptions

interface MongoFindOptions extends MongoOptions

MongoDB find options

NameDescription
sort
limit
skip
projection
Properties
  • readonlysort?Record<string, 1 | -1>
  • readonlylimit?number
  • readonlyskip?number
  • readonlyprojection?Record<string, 0 | 1>
interface

#MongoFindResultError

interface MongoFindResultError<T = Document> extends MongoFindResultBase<T>

Find result with MongoDB error.

NameDescription
processed
ok
error
docs
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorMongoError
  • readonlydocsreadonly T[]
interface

#MongoFindResultExpectation

interface MongoFindResultExpectation<_T = unknown>

Fluent API for MongoDB find result validation.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the find result is successful.
toHaveDocs()Asserts that the docs equal the expected value.
toHaveDocsEqual()Asserts that the docs equal the expected value using deep equality.
toHaveDocsStrictEqual()Asserts that the docs strictly equal the expected value.
toHaveDocsSatisfying()Asserts that the docs satisfy the provided matcher function.
toHaveDocsContaining()Asserts that the docs array contains the specified item.
toHaveDocsContainingEqual()Asserts that the docs array contains an item equal to the specified value.
toHaveDocsMatching()Asserts that the docs array matches the specified subset.
toHaveDocsEmpty()Asserts that the docs array is empty.
toHaveDocsCount()Asserts that the docs count equals the expected value.
toHaveDocsCountEqual()Asserts that the docs count equals the expected value using deep equality.
toHaveDocsCountStrictEqual()Asserts that the docs count strictly equals the expected value.
toHaveDocsCountSatisfying()Asserts that the docs count satisfies the provided matcher function.
toHaveDocsCountNaN()Asserts that the docs count is NaN.
toHaveDocsCountGreaterThan()Asserts that the docs count is greater than the expected value.
toHaveDocsCountGreaterThanOrEqual()Asserts that the docs count is greater than or equal to the expected value.
toHaveDocsCountLessThan()Asserts that the docs count is less than the expected value.
toHaveDocsCountLessThanOrEqual()Asserts that the docs count is less than or equal to the expected value.
toHaveDocsCountCloseTo()Asserts that the docs count is close to the expected value.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the find result is successful.

toHaveDocs(expected: unknown): this

Asserts that the docs equal the expected value.

Parameters
  • expectedunknown
    • The expected docs value
toHaveDocsEqual(expected: unknown): this

Asserts that the docs equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected docs value
toHaveDocsStrictEqual(expected: unknown): this

Asserts that the docs strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected docs value
toHaveDocsSatisfying(matcher: (value: MongoFindDocs<_T>) => unknown): this

Asserts that the docs satisfy the provided matcher function.

Parameters
  • matcher(value: MongoFindDocs<_T>) => unknown
    • A function that receives the docs and performs assertions
toHaveDocsContaining(item: unknown): this

Asserts that the docs array contains the specified item.

Parameters
  • itemunknown
    • The item to search for
toHaveDocsContainingEqual(item: unknown): this

Asserts that the docs array contains an item equal to the specified value.

Parameters
  • itemunknown
    • The item to search for using deep equality
toHaveDocsMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the docs array matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveDocsEmpty(): this

Asserts that the docs array is empty.

toHaveDocsCount(expected: unknown): this

Asserts that the docs count equals the expected value.

Parameters
  • expectedunknown
    • The expected docs count
toHaveDocsCountEqual(expected: unknown): this

Asserts that the docs count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected docs count
toHaveDocsCountStrictEqual(expected: unknown): this

Asserts that the docs count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected docs count
toHaveDocsCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the docs count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the docs count and performs assertions
toHaveDocsCountNaN(): this

Asserts that the docs count is NaN.

toHaveDocsCountGreaterThan(expected: number): this

Asserts that the docs count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDocsCountGreaterThanOrEqual(expected: number): this

Asserts that the docs count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDocsCountLessThan(expected: number): this

Asserts that the docs count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDocsCountLessThanOrEqual(expected: number): this

Asserts that the docs count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDocsCountCloseTo(expected: number, numDigits?: number): this

Asserts that the docs count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#MongoFindResultFailure

interface MongoFindResultFailure<T = Document> extends MongoFindResultBase<T>

Find result with connection failure.

NameDescription
processed
ok
error
docs
Properties
interface

#MongoFindResultSuccess

interface MongoFindResultSuccess<T = Document> extends MongoFindResultBase<T>

Successful find result.

NameDescription
processed
ok
error
docs
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlydocsreadonly T[]
interface

#MongoInsertManyResultError

interface MongoInsertManyResultError extends MongoInsertManyResultBase

InsertMany result with MongoDB error.

NameDescription
processed
ok
error
insertedIds
insertedCount
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorMongoError
  • readonlyinsertedIdsnull
  • readonlyinsertedCountnull
interface

#MongoInsertManyResultExpectation

interface MongoInsertManyResultExpectation

Fluent API for MongoDB insertMany result validation.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the insert result is successful.
toHaveInsertedIds()Asserts that the inserted IDs equal the expected value.
toHaveInsertedIdsEqual()Asserts that the inserted IDs equal the expected value using deep equality.
toHaveInsertedIdsStrictEqual()Asserts that the inserted IDs strictly equal the expected value.
toHaveInsertedIdsSatisfying()Asserts that the inserted IDs satisfy the provided matcher function.
toHaveInsertedIdsContaining()Asserts that the inserted IDs array contains the specified item.
toHaveInsertedIdsContainingEqual()Asserts that the inserted IDs array contains an item equal to the specified value.
toHaveInsertedIdsMatching()Asserts that the inserted IDs array matches the specified subset.
toHaveInsertedIdsEmpty()Asserts that the inserted IDs array is empty.
toHaveInsertedCount()Asserts that the inserted count equals the expected value.
toHaveInsertedCountEqual()Asserts that the inserted count equals the expected value using deep equality.
toHaveInsertedCountStrictEqual()Asserts that the inserted count strictly equals the expected value.
toHaveInsertedCountSatisfying()Asserts that the inserted count satisfies the provided matcher function.
toHaveInsertedCountNaN()Asserts that the inserted count is NaN.
toHaveInsertedCountGreaterThan()Asserts that the inserted count is greater than the expected value.
toHaveInsertedCountGreaterThanOrEqual()Asserts that the inserted count is greater than or equal to the expected value.
toHaveInsertedCountLessThan()Asserts that the inserted count is less than the expected value.
toHaveInsertedCountLessThanOrEqual()Asserts that the inserted count is less than or equal to the expected value.
toHaveInsertedCountCloseTo()Asserts that the inserted count is close to the expected value.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the insert result is successful.

toHaveInsertedIds(expected: unknown): this

Asserts that the inserted IDs equal the expected value.

Parameters
  • expectedunknown
    • The expected inserted IDs
toHaveInsertedIdsEqual(expected: unknown): this

Asserts that the inserted IDs equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected inserted IDs
toHaveInsertedIdsStrictEqual(expected: unknown): this

Asserts that the inserted IDs strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected inserted IDs
toHaveInsertedIdsSatisfying(matcher: (value: string[]) => unknown): this

Asserts that the inserted IDs satisfy the provided matcher function.

Parameters
  • matcher(value: string[]) => unknown
    • A function that receives the inserted IDs and performs assertions
toHaveInsertedIdsContaining(item: unknown): this

Asserts that the inserted IDs array contains the specified item.

Parameters
  • itemunknown
    • The item to search for
toHaveInsertedIdsContainingEqual(item: unknown): this

Asserts that the inserted IDs array contains an item equal to the specified value.

Parameters
  • itemunknown
    • The item to search for using deep equality
toHaveInsertedIdsMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the inserted IDs array matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveInsertedIdsEmpty(): this

Asserts that the inserted IDs array is empty.

toHaveInsertedCount(expected: unknown): this

Asserts that the inserted count equals the expected value.

Parameters
  • expectedunknown
    • The expected inserted count
toHaveInsertedCountEqual(expected: unknown): this

Asserts that the inserted count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected inserted count
toHaveInsertedCountStrictEqual(expected: unknown): this

Asserts that the inserted count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected inserted count
toHaveInsertedCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the inserted count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the inserted count and performs assertions
toHaveInsertedCountNaN(): this

Asserts that the inserted count is NaN.

toHaveInsertedCountGreaterThan(expected: number): this

Asserts that the inserted count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveInsertedCountGreaterThanOrEqual(expected: number): this

Asserts that the inserted count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveInsertedCountLessThan(expected: number): this

Asserts that the inserted count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveInsertedCountLessThanOrEqual(expected: number): this

Asserts that the inserted count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveInsertedCountCloseTo(expected: number, numDigits?: number): this

Asserts that the inserted count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#MongoInsertManyResultFailure

interface MongoInsertManyResultFailure extends MongoInsertManyResultBase

InsertMany result with connection failure.

NameDescription
processed
ok
error
insertedIds
insertedCount
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorMongoFailureError
  • readonlyinsertedIdsnull
  • readonlyinsertedCountnull
interface

#MongoInsertManyResultSuccess

interface MongoInsertManyResultSuccess extends MongoInsertManyResultBase

Successful insertMany result.

NameDescription
processed
ok
error
insertedIds
insertedCount
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyinsertedIdsreadonly string[]
  • readonlyinsertedCountnumber
interface

#MongoInsertOneResultError

interface MongoInsertOneResultError extends MongoInsertOneResultBase

InsertOne result with MongoDB error.

NameDescription
processed
ok
error
insertedId
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorMongoError
  • readonlyinsertedIdnull
interface

#MongoInsertOneResultExpectation

interface MongoInsertOneResultExpectation

Fluent API for MongoDB insertOne result validation.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the insert result is successful.
toHaveInsertedId()Asserts that the inserted ID equals the expected value.
toHaveInsertedIdEqual()Asserts that the inserted ID equals the expected value using deep equality.
toHaveInsertedIdStrictEqual()Asserts that the inserted ID strictly equals the expected value.
toHaveInsertedIdSatisfying()Asserts that the inserted ID satisfies the provided matcher function.
toHaveInsertedIdContaining()Asserts that the inserted ID contains the specified substring.
toHaveInsertedIdMatching()Asserts that the inserted ID matches the specified regular expression.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the insert result is successful.

toHaveInsertedId(expected: unknown): this

Asserts that the inserted ID equals the expected value.

Parameters
  • expectedunknown
    • The expected inserted ID
toHaveInsertedIdEqual(expected: unknown): this

Asserts that the inserted ID equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected inserted ID
toHaveInsertedIdStrictEqual(expected: unknown): this

Asserts that the inserted ID strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected inserted ID
toHaveInsertedIdSatisfying(matcher: (value: string) => unknown): this

Asserts that the inserted ID satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the inserted ID and performs assertions
toHaveInsertedIdContaining(substr: string): this

Asserts that the inserted ID contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveInsertedIdMatching(expected: RegExp): this

Asserts that the inserted ID matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#MongoInsertOneResultFailure

interface MongoInsertOneResultFailure extends MongoInsertOneResultBase

InsertOne result with connection failure.

NameDescription
processed
ok
error
insertedId
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorMongoFailureError
  • readonlyinsertedIdnull
interface

#MongoInsertOneResultSuccess

interface MongoInsertOneResultSuccess extends MongoInsertOneResultBase

Successful insertOne result.

NameDescription
processed
ok
error
insertedId
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyinsertedIdstring
interface

#MongoOptions

interface MongoOptions extends CommonOptions

Common options with throwOnError support.

NameDescription
throwOnErrorIf true, throws errors instead of returning them in the result.
Properties
  • readonlythrowOnError?boolean

    If true, throws errors instead of returning them in the result. If false (default), errors are returned in the result object.

interface

#MongoSession

interface MongoSession

MongoDB session interface (for transactions)

NameDescription
collection()
Methods
collection<T extends Document = Document>(name: string): MongoCollection<T>
Parameters
  • namestring
interface

#MongoUpdateOptions

interface MongoUpdateOptions extends MongoOptions

MongoDB update options

NameDescription
upsert
Properties
  • readonlyupsert?boolean
interface

#MongoUpdateResultError

interface MongoUpdateResultError extends MongoUpdateResultBase

Update result with MongoDB error.

Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorMongoError
  • readonlymatchedCountnull
  • readonlymodifiedCountnull
  • readonlyupsertedIdnull
interface

#MongoUpdateResultExpectation

interface MongoUpdateResultExpectation

Fluent API for MongoDB update result validation.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the update result is successful.
toHaveMatchedCount()Asserts that the matched count equals the expected value.
toHaveMatchedCountEqual()Asserts that the matched count equals the expected value using deep equality.
toHaveMatchedCountStrictEqual()Asserts that the matched count strictly equals the expected value.
toHaveMatchedCountSatisfying()Asserts that the matched count satisfies the provided matcher function.
toHaveMatchedCountNaN()Asserts that the matched count is NaN.
toHaveMatchedCountGreaterThan()Asserts that the matched count is greater than the expected value.
toHaveMatchedCountGreaterThanOrEqual()Asserts that the matched count is greater than or equal to the expected value.
toHaveMatchedCountLessThan()Asserts that the matched count is less than the expected value.
toHaveMatchedCountLessThanOrEqual()Asserts that the matched count is less than or equal to the expected value.
toHaveMatchedCountCloseTo()Asserts that the matched count is close to the expected value.
toHaveModifiedCount()Asserts that the modified count equals the expected value.
toHaveModifiedCountEqual()Asserts that the modified count equals the expected value using deep equality.
toHaveModifiedCountStrictEqual()Asserts that the modified count strictly equals the expected value.
toHaveModifiedCountSatisfying()Asserts that the modified count satisfies the provided matcher function.
toHaveModifiedCountNaN()Asserts that the modified count is NaN.
toHaveModifiedCountGreaterThan()Asserts that the modified count is greater than the expected value.
toHaveModifiedCountGreaterThanOrEqual()Asserts that the modified count is greater than or equal to the expected value.
toHaveModifiedCountLessThan()Asserts that the modified count is less than the expected value.
toHaveModifiedCountLessThanOrEqual()Asserts that the modified count is less than or equal to the expected value.
toHaveModifiedCountCloseTo()Asserts that the modified count is close to the expected value.
toHaveUpsertedId()Asserts that the upserted ID equals the expected value.
toHaveUpsertedIdEqual()Asserts that the upserted ID equals the expected value using deep equality.
toHaveUpsertedIdStrictEqual()Asserts that the upserted ID strictly equals the expected value.
toHaveUpsertedIdSatisfying()Asserts that the upserted ID satisfies the provided matcher function.
toHaveUpsertedIdPresent()Asserts that the upserted ID is present (not null or undefined).
toHaveUpsertedIdNull()Asserts that the upserted ID is null.
toHaveUpsertedIdUndefined()Asserts that the upserted ID is undefined.
toHaveUpsertedIdNullish()Asserts that the upserted ID is nullish (null or undefined).
toHaveUpsertedIdContaining()Asserts that the upserted ID contains the specified substring.
toHaveUpsertedIdMatching()Asserts that the upserted ID matches the specified regular expression.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the update result is successful.

toHaveMatchedCount(expected: unknown): this

Asserts that the matched count equals the expected value.

Parameters
  • expectedunknown
    • The expected matched count
toHaveMatchedCountEqual(expected: unknown): this

Asserts that the matched count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected matched count
toHaveMatchedCountStrictEqual(expected: unknown): this

Asserts that the matched count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected matched count
toHaveMatchedCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the matched count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the matched count and performs assertions
toHaveMatchedCountNaN(): this

Asserts that the matched count is NaN.

toHaveMatchedCountGreaterThan(expected: number): this

Asserts that the matched count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMatchedCountGreaterThanOrEqual(expected: number): this

Asserts that the matched count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMatchedCountLessThan(expected: number): this

Asserts that the matched count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMatchedCountLessThanOrEqual(expected: number): this

Asserts that the matched count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMatchedCountCloseTo(expected: number, numDigits?: number): this

Asserts that the matched count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveModifiedCount(expected: unknown): this

Asserts that the modified count equals the expected value.

Parameters
  • expectedunknown
    • The expected modified count
toHaveModifiedCountEqual(expected: unknown): this

Asserts that the modified count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected modified count
toHaveModifiedCountStrictEqual(expected: unknown): this

Asserts that the modified count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected modified count
toHaveModifiedCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the modified count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the modified count and performs assertions
toHaveModifiedCountNaN(): this

Asserts that the modified count is NaN.

toHaveModifiedCountGreaterThan(expected: number): this

Asserts that the modified count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveModifiedCountGreaterThanOrEqual(expected: number): this

Asserts that the modified count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveModifiedCountLessThan(expected: number): this

Asserts that the modified count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveModifiedCountLessThanOrEqual(expected: number): this

Asserts that the modified count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveModifiedCountCloseTo(expected: number, numDigits?: number): this

Asserts that the modified count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveUpsertedId(expected: unknown): this

Asserts that the upserted ID equals the expected value.

Parameters
  • expectedunknown
    • The expected upserted ID
toHaveUpsertedIdEqual(expected: unknown): this

Asserts that the upserted ID equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected upserted ID
toHaveUpsertedIdStrictEqual(expected: unknown): this

Asserts that the upserted ID strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected upserted ID
toHaveUpsertedIdSatisfying(matcher: (value: MongoUpsertedId) => unknown): this

Asserts that the upserted ID satisfies the provided matcher function.

Parameters
  • matcher(value: MongoUpsertedId) => unknown
    • A function that receives the upserted ID and performs assertions
toHaveUpsertedIdPresent(): this

Asserts that the upserted ID is present (not null or undefined).

toHaveUpsertedIdNull(): this

Asserts that the upserted ID is null.

toHaveUpsertedIdUndefined(): this

Asserts that the upserted ID is undefined.

toHaveUpsertedIdNullish(): this

Asserts that the upserted ID is nullish (null or undefined).

toHaveUpsertedIdContaining(substr: string): this

Asserts that the upserted ID contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveUpsertedIdMatching(expected: RegExp): this

Asserts that the upserted ID matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#MongoUpdateResultFailure

interface MongoUpdateResultFailure extends MongoUpdateResultBase

Update result with connection failure.

Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorMongoFailureError
  • readonlymatchedCountnull
  • readonlymodifiedCountnull
  • readonlyupsertedIdnull
interface

#MongoUpdateResultSuccess

interface MongoUpdateResultSuccess extends MongoUpdateResultBase

Successful update result.

Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlymatchedCountnumber
  • readonlymodifiedCountnumber
  • readonlyupsertedIdstring | null
interface

#RabbitMqAckResultError

interface RabbitMqAckResultError extends RabbitMqAckResultBase

Ack result with RabbitMQ error.

NameDescription
processed
ok
error
Properties
interface

#RabbitMqAckResultExpectation

interface RabbitMqAckResultExpectation

Fluent API for RabbitMQ ack result validation.

Provides chainable assertions for message acknowledgment results. Ack results only have ok and duration properties.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RabbitMqAckResultFailure

interface RabbitMqAckResultFailure extends RabbitMqAckResultBase

Ack result with connection failure.

NameDescription
processed
ok
error
Properties
interface

#RabbitMqAckResultSuccess

interface RabbitMqAckResultSuccess extends RabbitMqAckResultBase

Successful ack result.

NameDescription
processed
ok
error
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
interface

#RabbitMqChannel

interface RabbitMqChannel extends AsyncDisposable

RabbitMQ channel interface.

Methods
assertExchange(
  name: string,
  type: RabbitMqExchangeType,
  options?: RabbitMqExchangeOptions,
): Promise<RabbitMqExchangeResult>
Parameters
deleteExchange(
  name: string,
  options?: RabbitMqOptions,
): Promise<RabbitMqExchangeResult>
Parameters
assertQueue(
  name: string,
  options?: RabbitMqQueueOptions,
): Promise<RabbitMqQueueResult>
Parameters
deleteQueue(
  name: string,
  options?: RabbitMqOptions,
): Promise<RabbitMqQueueResult>
Parameters
purgeQueue(
  name: string,
  options?: RabbitMqOptions,
): Promise<RabbitMqQueueResult>
Parameters
bindQueue(
  queue: string,
  exchange: string,
  routingKey: string,
  options?: RabbitMqOptions,
): Promise<RabbitMqExchangeResult>
Parameters
unbindQueue(
  queue: string,
  exchange: string,
  routingKey: string,
  options?: RabbitMqOptions,
): Promise<RabbitMqExchangeResult>
Parameters
publish(
  exchange: string,
  routingKey: string,
  content: Uint8Array,
  options?: RabbitMqPublishOptions,
): Promise<RabbitMqPublishResult>
Parameters
sendToQueue(
  queue: string,
  content: Uint8Array,
  options?: RabbitMqPublishOptions,
): Promise<RabbitMqPublishResult>
Parameters
get(queue: string, options?: RabbitMqOptions): Promise<RabbitMqConsumeResult>
Parameters
consume(
  queue: string,
  options?: RabbitMqConsumeOptions,
): AsyncIterable<RabbitMqMessage>
Parameters
ack(
  message: RabbitMqMessage,
  options?: RabbitMqOptions,
): Promise<RabbitMqAckResult>
Parameters
nack(
  message: RabbitMqMessage,
  options?: RabbitMqNackOptions,
): Promise<RabbitMqAckResult>
Parameters
reject(
  message: RabbitMqMessage,
  options?: RabbitMqRejectOptions,
): Promise<RabbitMqAckResult>
Parameters
prefetch(count: number): Promise<void>
Parameters
  • countnumber
close(): Promise<void>
interface

#RabbitMqChannelErrorOptions

interface RabbitMqChannelErrorOptions extends RabbitMqErrorOptions

Options for RabbitMQ channel errors.

NameDescription
channelId
Properties
  • readonlychannelId?number
interface

#RabbitMqClient

interface RabbitMqClient extends AsyncDisposable

RabbitMQ client interface.

NameDescription
config
channel()
close()
Properties
Methods
channel(): Promise<RabbitMqChannel>
close(): Promise<void>
interface

#RabbitMqClientConfig

interface RabbitMqClientConfig extends CommonOptions

RabbitMQ client configuration.

NameDescription
urlRabbitMQ connection URL or configuration object.
heartbeatHeartbeat interval in seconds
prefetchDefault prefetch count for channels
throwOnErrorWhether to throw errors instead of returning them in results.
Properties
  • readonlyurlstring | RabbitMqConnectionConfig

    RabbitMQ connection URL or configuration object.

  • readonlyheartbeat?number

    Heartbeat interval in seconds

  • readonlyprefetch?number

    Default prefetch count for channels

  • readonlythrowOnError?boolean

    Whether to throw errors instead of returning them in results.

interface

#RabbitMqConnectionConfig

interface RabbitMqConnectionConfig extends CommonConnectionConfig

RabbitMQ connection configuration.

Extends CommonConnectionConfig with RabbitMQ-specific options.

NameDescription
vhostVirtual host.
Properties
  • readonlyvhost?string

    Virtual host.

interface

#RabbitMqConsumeOptions

interface RabbitMqConsumeOptions extends RabbitMqOptions

Consume options.

NameDescription
noAck
exclusive
priority
Properties
  • readonlynoAck?boolean
  • readonlyexclusive?boolean
  • readonlypriority?number
interface

#RabbitMqConsumeResultError

interface RabbitMqConsumeResultError extends RabbitMqConsumeResultBase

Consume result with RabbitMQ error.

NameDescription
processed
ok
error
message
Properties
interface

#RabbitMqConsumeResultExpectation

interface RabbitMqConsumeResultExpectation

Fluent API for RabbitMQ consume result validation.

Provides chainable assertions specifically designed for message consumption results including message content, properties, headers, and metadata.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveMessage()Asserts that the message equals the expected value.
toHaveMessageEqual()Asserts that the message equals the expected value using deep equality.
toHaveMessageStrictEqual()Asserts that the message strictly equals the expected value.
toHaveMessageSatisfying()Asserts that the message satisfies the provided matcher function.
toHaveMessagePresent()Asserts that the message is present (not null or undefined).
toHaveMessageNull()Asserts that the message is null (no message received).
toHaveMessageUndefined()Asserts that the message is undefined.
toHaveMessageNullish()Asserts that the message is nullish (null or undefined).
toHaveMessageMatching()Asserts that the message matches the specified subset.
toHaveMessageProperty()Asserts that the message has the specified property.
toHaveMessagePropertyContaining()Asserts that the message property contains the expected value.
toHaveMessagePropertyMatching()Asserts that the message property matches the specified subset.
toHaveMessagePropertySatisfying()Asserts that the message property satisfies the provided matcher function.
toHaveContent()Asserts that the content equals the expected value.
toHaveContentEqual()Asserts that the content equals the expected value using deep equality.
toHaveContentStrictEqual()Asserts that the content strictly equals the expected value.
toHaveContentSatisfying()Asserts that the content satisfies the provided matcher function.
toHaveContentPresent()Asserts that the content is present (not null or undefined).
toHaveContentNull()Asserts that the content is null.
toHaveContentUndefined()Asserts that the content is undefined.
toHaveContentNullish()Asserts that the content is nullish (null or undefined).
toHaveContentLength()Asserts that the content length equals the expected value.
toHaveContentLengthEqual()Asserts that the content length equals the expected value using deep equality.
toHaveContentLengthStrictEqual()Asserts that the content length strictly equals the expected value.
toHaveContentLengthSatisfying()Asserts that the content length satisfies the provided matcher function.
toHaveContentLengthNaN()Asserts that the content length is NaN.
toHaveContentLengthGreaterThan()Asserts that the content length is greater than the expected value.
toHaveContentLengthGreaterThanOrEqual()Asserts that the content length is greater than or equal to the expected value.
toHaveContentLengthLessThan()Asserts that the content length is less than the expected value.
toHaveContentLengthLessThanOrEqual()Asserts that the content length is less than or equal to the expected value.
toHaveContentLengthCloseTo()Asserts that the content length is close to the expected value.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveMessage(expected: unknown): this

Asserts that the message equals the expected value.

Parameters
  • expectedunknown
    • The expected message
toHaveMessageEqual(expected: unknown): this

Asserts that the message equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected message
toHaveMessageStrictEqual(expected: unknown): this

Asserts that the message strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected message
toHaveMessageSatisfying(matcher: (value: any) => unknown): this

Asserts that the message satisfies the provided matcher function.

Parameters
  • matcher(value: any) => unknown
    • A function that receives the message and performs assertions
toHaveMessagePresent(): this

Asserts that the message is present (not null or undefined).

toHaveMessageNull(): this

Asserts that the message is null (no message received).

toHaveMessageUndefined(): this

Asserts that the message is undefined.

toHaveMessageNullish(): this

Asserts that the message is nullish (null or undefined).

toHaveMessageMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the message matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveMessageProperty(keyPath: string | string[], value?: unknown): this

Asserts that the message has the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveMessagePropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the message property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveMessagePropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the message property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveMessagePropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the message property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveContent(expected: unknown): this

Asserts that the content equals the expected value.

Parameters
  • expectedunknown
    • The expected content
toHaveContentEqual(expected: unknown): this

Asserts that the content equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected content
toHaveContentStrictEqual(expected: unknown): this

Asserts that the content strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected content
toHaveContentSatisfying(matcher: (value: any) => unknown): this

Asserts that the content satisfies the provided matcher function.

Parameters
  • matcher(value: any) => unknown
    • A function that receives the content and performs assertions
toHaveContentPresent(): this

Asserts that the content is present (not null or undefined).

toHaveContentNull(): this

Asserts that the content is null.

toHaveContentUndefined(): this

Asserts that the content is undefined.

toHaveContentNullish(): this

Asserts that the content is nullish (null or undefined).

toHaveContentLength(expected: unknown): this

Asserts that the content length equals the expected value.

Parameters
  • expectedunknown
    • The expected content length
toHaveContentLengthEqual(expected: unknown): this

Asserts that the content length equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected content length
toHaveContentLengthStrictEqual(expected: unknown): this

Asserts that the content length strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected content length
toHaveContentLengthSatisfying(matcher: (value: number) => unknown): this

Asserts that the content length satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the content length and performs assertions
toHaveContentLengthNaN(): this

Asserts that the content length is NaN.

toHaveContentLengthGreaterThan(expected: number): this

Asserts that the content length is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveContentLengthGreaterThanOrEqual(expected: number): this

Asserts that the content length is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveContentLengthLessThan(expected: number): this

Asserts that the content length is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveContentLengthLessThanOrEqual(expected: number): this

Asserts that the content length is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveContentLengthCloseTo(expected: number, numDigits?: number): this

Asserts that the content length is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RabbitMqConsumeResultFailure

interface RabbitMqConsumeResultFailure extends RabbitMqConsumeResultBase

Consume result with connection failure.

NameDescription
processed
ok
error
message
Properties
interface

#RabbitMqConsumeResultSuccess

interface RabbitMqConsumeResultSuccess extends RabbitMqConsumeResultBase

Successful consume result.

NameDescription
processed
ok
error
message
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlymessageRabbitMqMessage | null
interface

#RabbitMqErrorOptions

interface RabbitMqErrorOptions extends ErrorOptions

Options for RabbitMQ errors.

NameDescription
code
Properties
  • readonlycode?number
interface

#RabbitMqExchangeOptions

interface RabbitMqExchangeOptions extends RabbitMqOptions

Exchange options.

NameDescription
durable
autoDelete
internal
arguments
Properties
  • readonlydurable?boolean
  • readonlyautoDelete?boolean
  • readonlyinternal?boolean
  • readonlyarguments?Record<string, unknown>
interface

#RabbitMqExchangeResultError

interface RabbitMqExchangeResultError extends RabbitMqExchangeResultBase

Exchange result with RabbitMQ error.

NameDescription
processed
ok
error
Properties
interface

#RabbitMqExchangeResultExpectation

interface RabbitMqExchangeResultExpectation

Fluent API for RabbitMQ exchange result validation.

Provides chainable assertions for exchange declaration/deletion results. Exchange results only have ok and duration properties.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RabbitMqExchangeResultFailure

interface RabbitMqExchangeResultFailure extends RabbitMqExchangeResultBase

Exchange result with connection failure.

NameDescription
processed
ok
error
Properties
interface

#RabbitMqExchangeResultSuccess

interface RabbitMqExchangeResultSuccess extends RabbitMqExchangeResultBase

Successful exchange result.

NameDescription
processed
ok
error
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
interface

#RabbitMqMessage

interface RabbitMqMessage

RabbitMQ message.

NameDescription
content
properties
fields
Properties
interface

#RabbitMqMessageFields

interface RabbitMqMessageFields

RabbitMQ message fields.

NameDescription
deliveryTag
redelivered
exchange
routingKey
Properties
  • readonlydeliveryTagbigint
  • readonlyredeliveredboolean
  • readonlyexchangestring
  • readonlyroutingKeystring
interface

#RabbitMqMessageProperties

interface RabbitMqMessageProperties

RabbitMQ message properties.

NameDescription
contentType
contentEncoding
headers
deliveryMode1: non-persistent, 2: persistent
priority
correlationId
replyTo
expiration
messageId
timestamp
type
userId
appId
Properties
  • readonlycontentType?string
  • readonlycontentEncoding?string
  • readonlyheaders?Record<string, unknown>
  • readonlydeliveryMode?1 | 2

    1: non-persistent, 2: persistent

  • readonlypriority?number
  • readonlycorrelationId?string
  • readonlyreplyTo?string
  • readonlyexpiration?string
  • readonlymessageId?string
  • readonlytimestamp?number
  • readonlytype?string
  • readonlyuserId?string
  • readonlyappId?string
interface

#RabbitMqNackOptions

interface RabbitMqNackOptions extends RabbitMqOptions

Nack options.

NameDescription
requeue
allUpTo
Properties
  • readonlyrequeue?boolean
  • readonlyallUpTo?boolean
interface

#RabbitMqNotFoundErrorOptions

interface RabbitMqNotFoundErrorOptions extends RabbitMqErrorOptions

Options for RabbitMQ not found errors.

NameDescription
resource
Properties
  • readonlyresourcestring
interface

#RabbitMqOptions

interface RabbitMqOptions extends CommonOptions

Base options for RabbitMQ operations.

NameDescription
throwOnErrorWhether to throw errors instead of returning them in results.
Properties
  • readonlythrowOnError?boolean

    Whether to throw errors instead of returning them in results. Overrides the client-level throwOnError setting.

interface

#RabbitMqPreconditionFailedErrorOptions

interface RabbitMqPreconditionFailedErrorOptions extends RabbitMqErrorOptions

Options for RabbitMQ precondition failed errors.

NameDescription
reason
Properties
  • readonlyreasonstring
interface

#RabbitMqPublishOptions

interface RabbitMqPublishOptions extends RabbitMqOptions

Publish options.

Properties
  • readonlypersistent?boolean
  • readonlycontentType?string
  • readonlycontentEncoding?string
  • readonlyheaders?Record<string, unknown>
  • readonlycorrelationId?string
  • readonlyreplyTo?string
  • readonlyexpiration?string
  • readonlymessageId?string
  • readonlypriority?number
interface

#RabbitMqPublishResultError

interface RabbitMqPublishResultError extends RabbitMqPublishResultBase

Publish result with RabbitMQ error.

NameDescription
processed
ok
error
Properties
interface

#RabbitMqPublishResultExpectation

interface RabbitMqPublishResultExpectation

Fluent API for RabbitMQ publish result validation. Publish results only have ok and duration properties.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RabbitMqPublishResultFailure

interface RabbitMqPublishResultFailure extends RabbitMqPublishResultBase

Publish result with connection failure.

NameDescription
processed
ok
error
Properties
interface

#RabbitMqPublishResultSuccess

interface RabbitMqPublishResultSuccess extends RabbitMqPublishResultBase

Successful publish result.

NameDescription
processed
ok
error
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
interface

#RabbitMqQueueOptions

interface RabbitMqQueueOptions extends RabbitMqOptions

Queue options.

Properties
  • readonlydurable?boolean
  • readonlyexclusive?boolean
  • readonlyautoDelete?boolean
  • readonlyarguments?Record<string, unknown>
  • readonlymessageTtl?number
  • readonlymaxLength?number
  • readonlydeadLetterExchange?string
  • readonlydeadLetterRoutingKey?string
interface

#RabbitMqQueueResultError

interface RabbitMqQueueResultError extends RabbitMqQueueResultBase

Queue result with RabbitMQ error.

NameDescription
processed
ok
error
queue
messageCount
consumerCount
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyqueuenull
  • readonlymessageCountnull
  • readonlyconsumerCountnull
interface

#RabbitMqQueueResultExpectation

interface RabbitMqQueueResultExpectation

Fluent API for RabbitMQ queue result validation.

Provides chainable assertions specifically designed for queue declaration results (e.g., assertQueue, checkQueue operations).

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveQueue()Asserts that the queue name equals the expected value.
toHaveQueueEqual()Asserts that the queue name equals the expected value using deep equality.
toHaveQueueStrictEqual()Asserts that the queue name strictly equals the expected value.
toHaveQueueSatisfying()Asserts that the queue name satisfies the provided matcher function.
toHaveQueueContaining()Asserts that the queue name contains the specified substring.
toHaveQueueMatching()Asserts that the queue name matches the specified regular expression.
toHaveMessageCount()Asserts that the message count equals the expected value.
toHaveMessageCountEqual()Asserts that the message count equals the expected value using deep equality.
toHaveMessageCountStrictEqual()Asserts that the message count strictly equals the expected value.
toHaveMessageCountSatisfying()Asserts that the message count satisfies the provided matcher function.
toHaveMessageCountNaN()Asserts that the message count is NaN.
toHaveMessageCountGreaterThan()Asserts that the message count is greater than the expected value.
toHaveMessageCountGreaterThanOrEqual()Asserts that the message count is greater than or equal to the expected value.
toHaveMessageCountLessThan()Asserts that the message count is less than the expected value.
toHaveMessageCountLessThanOrEqual()Asserts that the message count is less than or equal to the expected value.
toHaveMessageCountCloseTo()Asserts that the message count is close to the expected value.
toHaveConsumerCount()Asserts that the consumer count equals the expected value.
toHaveConsumerCountEqual()Asserts that the consumer count equals the expected value using deep equality.
toHaveConsumerCountStrictEqual()Asserts that the consumer count strictly equals the expected value.
toHaveConsumerCountSatisfying()Asserts that the consumer count satisfies the provided matcher function.
toHaveConsumerCountNaN()Asserts that the consumer count is NaN.
toHaveConsumerCountGreaterThan()Asserts that the consumer count is greater than the expected value.
toHaveConsumerCountGreaterThanOrEqual()Asserts that the consumer count is greater than or equal to the expected value.
toHaveConsumerCountLessThan()Asserts that the consumer count is less than the expected value.
toHaveConsumerCountLessThanOrEqual()Asserts that the consumer count is less than or equal to the expected value.
toHaveConsumerCountCloseTo()Asserts that the consumer count is close to the expected value.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveQueue(expected: unknown): this

Asserts that the queue name equals the expected value.

Parameters
  • expectedunknown
    • The expected queue name
toHaveQueueEqual(expected: unknown): this

Asserts that the queue name equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected queue name
toHaveQueueStrictEqual(expected: unknown): this

Asserts that the queue name strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected queue name
toHaveQueueSatisfying(matcher: (value: string) => unknown): this

Asserts that the queue name satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the queue name and performs assertions
toHaveQueueContaining(substr: string): this

Asserts that the queue name contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveQueueMatching(expected: RegExp): this

Asserts that the queue name matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveMessageCount(expected: unknown): this

Asserts that the message count equals the expected value.

Parameters
  • expectedunknown
    • The expected message count
toHaveMessageCountEqual(expected: unknown): this

Asserts that the message count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected message count
toHaveMessageCountStrictEqual(expected: unknown): this

Asserts that the message count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected message count
toHaveMessageCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the message count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the message count and performs assertions
toHaveMessageCountNaN(): this

Asserts that the message count is NaN.

toHaveMessageCountGreaterThan(expected: number): this

Asserts that the message count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMessageCountGreaterThanOrEqual(expected: number): this

Asserts that the message count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMessageCountLessThan(expected: number): this

Asserts that the message count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMessageCountLessThanOrEqual(expected: number): this

Asserts that the message count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMessageCountCloseTo(expected: number, numDigits?: number): this

Asserts that the message count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveConsumerCount(expected: unknown): this

Asserts that the consumer count equals the expected value.

Parameters
  • expectedunknown
    • The expected consumer count
toHaveConsumerCountEqual(expected: unknown): this

Asserts that the consumer count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected consumer count
toHaveConsumerCountStrictEqual(expected: unknown): this

Asserts that the consumer count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected consumer count
toHaveConsumerCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the consumer count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the consumer count and performs assertions
toHaveConsumerCountNaN(): this

Asserts that the consumer count is NaN.

toHaveConsumerCountGreaterThan(expected: number): this

Asserts that the consumer count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveConsumerCountGreaterThanOrEqual(expected: number): this

Asserts that the consumer count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveConsumerCountLessThan(expected: number): this

Asserts that the consumer count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveConsumerCountLessThanOrEqual(expected: number): this

Asserts that the consumer count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveConsumerCountCloseTo(expected: number, numDigits?: number): this

Asserts that the consumer count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RabbitMqQueueResultFailure

interface RabbitMqQueueResultFailure extends RabbitMqQueueResultBase

Queue result with connection failure.

NameDescription
processed
ok
error
queue
messageCount
consumerCount
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyqueuenull
  • readonlymessageCountnull
  • readonlyconsumerCountnull
interface

#RabbitMqQueueResultSuccess

interface RabbitMqQueueResultSuccess extends RabbitMqQueueResultBase

Successful queue result.

NameDescription
processed
ok
error
queue
messageCount
consumerCount
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyqueuestring
  • readonlymessageCountnumber
  • readonlyconsumerCountnumber
interface

#RabbitMqRejectOptions

interface RabbitMqRejectOptions extends RabbitMqOptions

Reject options.

NameDescription
requeue
Properties
  • readonlyrequeue?boolean
interface

#RedisArrayResultError

interface RedisArrayResultError<T = string> extends RedisArrayResultBase<T>

Array result with Redis error.

NameDescription
processed
ok
error
value
Properties
interface

#RedisArrayResultExpectation

interface RedisArrayResultExpectation

Fluent API for Redis array result validation.

Provides chainable assertions specifically designed for array-based results (e.g., LRANGE, SMEMBERS, KEYS operations).

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveValue()Asserts that the value equals the expected value.
toHaveValueEqual()Asserts that the value equals the expected value using deep equality.
toHaveValueStrictEqual()Asserts that the value strictly equals the expected value.
toHaveValueSatisfying()Asserts that the value satisfies the provided matcher function.
toHaveValueContaining()Asserts that the value array contains the specified item.
toHaveValueContainingEqual()Asserts that the value array contains an item equal to the specified value.
toHaveValueMatching()Asserts that the value array matches the specified subset.
toHaveValueEmpty()Asserts that the value array is empty.
toHaveValueCount()Asserts that the value count equals the expected value.
toHaveValueCountEqual()Asserts that the value count equals the expected value using deep equality.
toHaveValueCountStrictEqual()Asserts that the value count strictly equals the expected value.
toHaveValueCountSatisfying()Asserts that the value count satisfies the provided matcher function.
toHaveValueCountNaN()Asserts that the value count is NaN.
toHaveValueCountGreaterThan()Asserts that the value count is greater than the expected value.
toHaveValueCountGreaterThanOrEqual()Asserts that the value count is greater than or equal to the expected value.
toHaveValueCountLessThan()Asserts that the value count is less than the expected value.
toHaveValueCountLessThanOrEqual()Asserts that the value count is less than or equal to the expected value.
toHaveValueCountCloseTo()Asserts that the value count is close to the expected value.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveValue(expected: unknown): this

Asserts that the value equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueEqual(expected: unknown): this

Asserts that the value equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected value
toHaveValueStrictEqual(expected: unknown): this

Asserts that the value strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueSatisfying(matcher: (value: RedisArrayValue) => unknown): this

Asserts that the value satisfies the provided matcher function.

Parameters
  • matcher(value: RedisArrayValue) => unknown
    • A function that receives the value and performs assertions
toHaveValueContaining(item: unknown): this

Asserts that the value array contains the specified item.

Parameters
  • itemunknown
    • The item to search for
toHaveValueContainingEqual(item: unknown): this

Asserts that the value array contains an item equal to the specified value.

Parameters
  • itemunknown
    • The item to search for using deep equality
toHaveValueMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the value array matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveValueEmpty(): this

Asserts that the value array is empty.

toHaveValueCount(expected: unknown): this

Asserts that the value count equals the expected value.

Parameters
  • expectedunknown
    • The expected value count
toHaveValueCountEqual(expected: unknown): this

Asserts that the value count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected value count
toHaveValueCountStrictEqual(expected: unknown): this

Asserts that the value count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected value count
toHaveValueCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the value count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the value count and performs assertions
toHaveValueCountNaN(): this

Asserts that the value count is NaN.

toHaveValueCountGreaterThan(expected: number): this

Asserts that the value count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveValueCountGreaterThanOrEqual(expected: number): this

Asserts that the value count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveValueCountLessThan(expected: number): this

Asserts that the value count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveValueCountLessThanOrEqual(expected: number): this

Asserts that the value count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveValueCountCloseTo(expected: number, numDigits?: number): this

Asserts that the value count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RedisArrayResultFailure

interface RedisArrayResultFailure<T = string> extends RedisArrayResultBase<T>

Array result with connection failure.

NameDescription
processed
ok
error
value
Properties
interface

#RedisArrayResultSuccess

interface RedisArrayResultSuccess<T = string> extends RedisArrayResultBase<T>

Successful array result.

NameDescription
processed
ok
error
value
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyvaluereadonly T[]
interface

#RedisClient

interface RedisClient extends AsyncDisposable

Redis client interface

Properties
Methods
get(key: string, options?: RedisCommandOptions): Promise<RedisGetResult>
Parameters
set(
  key: string,
  value: string,
  options?: RedisSetOptions,
): Promise<RedisSetResult>
Parameters
del(keys: string[], options?: RedisCommandOptions): Promise<RedisCountResult>
Parameters
incr(key: string, options?: RedisCommandOptions): Promise<RedisCountResult>
Parameters
decr(key: string, options?: RedisCommandOptions): Promise<RedisCountResult>
Parameters
hget(
  key: string,
  field: string,
  options?: RedisCommandOptions,
): Promise<RedisGetResult>
Parameters
hset(
  key: string,
  field: string,
  value: string,
  options?: RedisCommandOptions,
): Promise<RedisCountResult>
Parameters
hgetall(key: string, options?: RedisCommandOptions): Promise<RedisHashResult>
Parameters
hdel(
  key: string,
  fields: string[],
  options?: RedisCommandOptions,
): Promise<RedisCountResult>
Parameters
lpush(
  key: string,
  values: string[],
  options?: RedisCommandOptions,
): Promise<RedisCountResult>
Parameters
rpush(
  key: string,
  values: string[],
  options?: RedisCommandOptions,
): Promise<RedisCountResult>
Parameters
lpop(key: string, options?: RedisCommandOptions): Promise<RedisGetResult>
Parameters
rpop(key: string, options?: RedisCommandOptions): Promise<RedisGetResult>
Parameters
lrange(
  key: string,
  start: number,
  stop: number,
  options?: RedisCommandOptions,
): Promise<RedisArrayResult>
Parameters
llen(key: string, options?: RedisCommandOptions): Promise<RedisCountResult>
Parameters
sadd(
  key: string,
  members: string[],
  options?: RedisCommandOptions,
): Promise<RedisCountResult>
Parameters
srem(
  key: string,
  members: string[],
  options?: RedisCommandOptions,
): Promise<RedisCountResult>
Parameters
smembers(key: string, options?: RedisCommandOptions): Promise<RedisArrayResult>
Parameters
sismember(
  key: string,
  member: string,
  options?: RedisCommandOptions,
): Promise<RedisCommonResult<boolean>>
Parameters
zadd(
  key: string,
  entries: { score: number; member: string }[],
  options?: RedisCommandOptions,
): Promise<RedisCountResult>
Parameters
zrange(
  key: string,
  start: number,
  stop: number,
  options?: RedisCommandOptions,
): Promise<RedisArrayResult>
Parameters
zscore(
  key: string,
  member: string,
  options?: RedisCommandOptions,
): Promise<RedisCommonResult<number | null>>
Parameters
publish(
  channel: string,
  message: string,
  options?: RedisCommandOptions,
): Promise<RedisCountResult>
Parameters
subscribe(channel: string): AsyncIterable<RedisMessage>
Parameters
  • channelstring
multi(): RedisTransaction
command<T = any>(
  cmd: string,
  args: unknown[],
  options?: RedisCommandOptions,
): Promise<RedisCommonResult<T>>
Parameters
close(): Promise<void>
interface

#RedisClientConfig

interface RedisClientConfig extends CommonOptions

Redis client configuration.

NameDescription
urlRedis connection URL or configuration object.
throwOnErrorWhether to throw an error when operations fail.
Properties
  • readonlyurlstring | RedisConnectionConfig

    Redis connection URL or configuration object.

  • readonlythrowOnError?boolean

    Whether to throw an error when operations fail.

    When true, failures will throw an error instead of returning a result with ok: false. This can be overridden per-command.

interface

#RedisCommandErrorOptions

interface RedisCommandErrorOptions extends RedisErrorOptions

Options for Redis command errors.

NameDescription
command
Properties
  • readonlycommandstring
interface

#RedisCommandOptions

interface RedisCommandOptions extends CommonOptions

Redis command options.

Extends CommonOptions with Redis-specific behavior options.

NameDescription
throwOnErrorWhether to throw an error when the operation fails.
Properties
  • readonlythrowOnError?boolean

    Whether to throw an error when the operation fails.

    When true, failures will throw an error instead of returning a result with ok: false.

interface

#RedisCommonResultError

interface RedisCommonResultError<T = any> extends RedisCommonResultBase<T>

Common result with Redis error.

NameDescription
processed
ok
error
value
Properties
interface

#RedisCommonResultExpectation

interface RedisCommonResultExpectation

Fluent API for Redis common result validation.

Provides chainable assertions for generic Redis operation results.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveValue()Asserts that the value equals the expected value.
toHaveValueEqual()Asserts that the value equals the expected value using deep equality.
toHaveValueStrictEqual()Asserts that the value strictly equals the expected value.
toHaveValueSatisfying()Asserts that the value satisfies the provided matcher function.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveValue(expected: unknown): this

Asserts that the value equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueEqual(expected: unknown): this

Asserts that the value equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected value
toHaveValueStrictEqual(expected: unknown): this

Asserts that the value strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueSatisfying(matcher: (value: any) => unknown): this

Asserts that the value satisfies the provided matcher function.

Parameters
  • matcher(value: any) => unknown
    • A function that receives the value and performs assertions
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RedisCommonResultFailure

interface RedisCommonResultFailure<T = any> extends RedisCommonResultBase<T>

Common result with connection failure.

NameDescription
processed
ok
error
value
Properties
interface

#RedisCommonResultSuccess

interface RedisCommonResultSuccess<T = any> extends RedisCommonResultBase<T>

Successful common result.

NameDescription
processed
ok
error
value
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyvalueT
interface

#RedisConnectionConfig

interface RedisConnectionConfig extends CommonConnectionConfig

Redis connection configuration.

Extends CommonConnectionConfig with Redis-specific options.

NameDescription
dbDatabase index.
Properties
  • readonlydb?number

    Database index.

interface

#RedisCountResultError

interface RedisCountResultError extends RedisCountResultBase

Count result with Redis error.

NameDescription
processed
ok
error
value
Properties
interface

#RedisCountResultExpectation

interface RedisCountResultExpectation

Fluent API for Redis count result validation.

Provides chainable assertions specifically designed for count-based results (e.g., DEL, LPUSH, SCARD operations).

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveValue()Asserts that the value equals the expected value.
toHaveValueEqual()Asserts that the value equals the expected value using deep equality.
toHaveValueStrictEqual()Asserts that the value strictly equals the expected value.
toHaveValueSatisfying()Asserts that the value satisfies the provided matcher function.
toHaveValueNaN()Asserts that the value is NaN.
toHaveValueGreaterThan()Asserts that the value is greater than the expected value.
toHaveValueGreaterThanOrEqual()Asserts that the value is greater than or equal to the expected value.
toHaveValueLessThan()Asserts that the value is less than the expected value.
toHaveValueLessThanOrEqual()Asserts that the value is less than or equal to the expected value.
toHaveValueCloseTo()Asserts that the value is close to the expected value.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveValue(expected: unknown): this

Asserts that the value equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueEqual(expected: unknown): this

Asserts that the value equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected value
toHaveValueStrictEqual(expected: unknown): this

Asserts that the value strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueSatisfying(matcher: (value: number) => unknown): this

Asserts that the value satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the value and performs assertions
toHaveValueNaN(): this

Asserts that the value is NaN.

toHaveValueGreaterThan(expected: number): this

Asserts that the value is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveValueGreaterThanOrEqual(expected: number): this

Asserts that the value is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveValueLessThan(expected: number): this

Asserts that the value is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveValueLessThanOrEqual(expected: number): this

Asserts that the value is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveValueCloseTo(expected: number, numDigits?: number): this

Asserts that the value is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RedisCountResultFailure

interface RedisCountResultFailure extends RedisCountResultBase

Count result with connection failure.

NameDescription
processed
ok
error
value
Properties
interface

#RedisCountResultSuccess

interface RedisCountResultSuccess extends RedisCountResultBase

Successful count result.

NameDescription
processed
ok
error
value
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyvaluenumber
interface

#RedisErrorOptions

interface RedisErrorOptions extends ErrorOptions

Options for Redis errors.

NameDescription
code
Properties
  • readonlycode?string
interface

#RedisGetResultError

interface RedisGetResultError extends RedisGetResultBase

GET result with Redis error.

NameDescription
processed
ok
error
value
Properties
interface

#RedisGetResultExpectation

interface RedisGetResultExpectation

Fluent API for Redis get result validation.

Provides chainable assertions specifically designed for Redis GET operation results.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveValue()Asserts that the value equals the expected value.
toHaveValueEqual()Asserts that the value equals the expected value using deep equality.
toHaveValueStrictEqual()Asserts that the value strictly equals the expected value.
toHaveValueSatisfying()Asserts that the value satisfies the provided matcher function.
toHaveValueContaining()Asserts that the value contains the specified substring.
toHaveValueMatching()Asserts that the value matches the specified regular expression.
toHaveValuePresent()Asserts that the value is present (not null or undefined).
toHaveValueNull()Asserts that the value is null.
toHaveValueUndefined()Asserts that the value is undefined.
toHaveValueNullish()Asserts that the value is nullish (null or undefined).
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveValue(expected: unknown): this

Asserts that the value equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueEqual(expected: unknown): this

Asserts that the value equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected value
toHaveValueStrictEqual(expected: unknown): this

Asserts that the value strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueSatisfying(matcher: (value: string) => unknown): this

Asserts that the value satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the value and performs assertions
toHaveValueContaining(substr: string): this

Asserts that the value contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveValueMatching(expected: RegExp): this

Asserts that the value matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveValuePresent(): this

Asserts that the value is present (not null or undefined).

toHaveValueNull(): this

Asserts that the value is null.

toHaveValueUndefined(): this

Asserts that the value is undefined.

toHaveValueNullish(): this

Asserts that the value is nullish (null or undefined).

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RedisGetResultFailure

interface RedisGetResultFailure extends RedisGetResultBase

GET result with connection failure.

NameDescription
processed
ok
error
value
Properties
interface

#RedisGetResultSuccess

interface RedisGetResultSuccess extends RedisGetResultBase

Successful GET result.

NameDescription
processed
ok
error
value
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyvaluestring | null
interface

#RedisHashResultError

interface RedisHashResultError extends RedisHashResultBase

Hash result with Redis error.

NameDescription
processed
ok
error
value
Properties
interface

#RedisHashResultExpectation

interface RedisHashResultExpectation

Fluent API for Redis hash result validation.

Provides chainable assertions specifically designed for hash-based results (e.g., HGETALL, HMGET operations).

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveValue()Asserts that the value equals the expected value.
toHaveValueEqual()Asserts that the value equals the expected value using deep equality.
toHaveValueStrictEqual()Asserts that the value strictly equals the expected value.
toHaveValueSatisfying()Asserts that the value satisfies the provided matcher function.
toHaveValueMatching()Asserts that the value matches the specified subset.
toHaveValueProperty()Asserts that the value has the specified property.
toHaveValuePropertyContaining()Asserts that the value property contains the expected value.
toHaveValuePropertyMatching()Asserts that the value property matches the specified subset.
toHaveValuePropertySatisfying()Asserts that the value property satisfies the provided matcher function.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveValue(expected: unknown): this

Asserts that the value equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueEqual(expected: unknown): this

Asserts that the value equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected value
toHaveValueStrictEqual(expected: unknown): this

Asserts that the value strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueSatisfying(matcher: (value: any) => unknown): this

Asserts that the value satisfies the provided matcher function.

Parameters
  • matcher(value: any) => unknown
    • A function that receives the value and performs assertions
toHaveValueMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the value matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveValueProperty(keyPath: string | string[], value?: unknown): this

Asserts that the value has the specified property.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • value?unknown
    • Optional expected value at the key path
toHaveValuePropertyContaining(
  keyPath: string | string[],
  expected: unknown,
): this

Asserts that the value property contains the expected value.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • expectedunknown
    • The expected contained value
toHaveValuePropertyMatching(
  keyPath: string | string[],
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the value property matches the specified subset.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveValuePropertySatisfying(
  keyPath: string | string[],
  matcher: (value: any) => unknown,
): this

Asserts that the value property satisfies the provided matcher function.

Parameters
  • keyPathstring | string[]
    • Property path as dot-separated string ("user.name") or array (["user", "name"]). Use array format for properties containing dots.
  • matcher(value: any) => unknown
    • A function that receives the property value and performs assertions
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RedisHashResultFailure

interface RedisHashResultFailure extends RedisHashResultBase

Hash result with connection failure.

NameDescription
processed
ok
error
value
Properties
interface

#RedisHashResultSuccess

interface RedisHashResultSuccess extends RedisHashResultBase

Successful hash result.

NameDescription
processed
ok
error
value
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyvalueRecord<string, string>
interface

#RedisMessage

interface RedisMessage

Redis Pub/Sub message

NameDescription
channel
message
Properties
  • readonlychannelstring
  • readonlymessagestring
interface

#RedisScriptErrorOptions

interface RedisScriptErrorOptions extends RedisErrorOptions

Options for Redis script errors.

NameDescription
script
Properties
  • readonlyscriptstring
interface

#RedisSetOptions

interface RedisSetOptions extends RedisCommandOptions

Redis SET options

NameDescription
exExpiration in seconds
pxExpiration in milliseconds
nxOnly set if key does not exist
xxOnly set if key exists
Properties
  • readonlyex?number

    Expiration in seconds

  • readonlypx?number

    Expiration in milliseconds

  • readonlynx?boolean

    Only set if key does not exist

  • readonlyxx?boolean

    Only set if key exists

interface

#RedisSetResultError

interface RedisSetResultError extends RedisSetResultBase

SET result with Redis error.

NameDescription
processed
ok
error
value
Properties
interface

#RedisSetResultExpectation

interface RedisSetResultExpectation

Fluent API for Redis set result validation.

Provides chainable assertions specifically designed for Redis SET operation results.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveValue()Asserts that the value equals the expected value.
toHaveValueEqual()Asserts that the value equals the expected value using deep equality.
toHaveValueStrictEqual()Asserts that the value strictly equals the expected value.
toHaveValueSatisfying()Asserts that the value satisfies the provided matcher function.
toHaveValueContaining()Asserts that the value contains the specified substring.
toHaveValueMatching()Asserts that the value matches the specified regular expression.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveValue(expected: unknown): this

Asserts that the value equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueEqual(expected: unknown): this

Asserts that the value equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected value
toHaveValueStrictEqual(expected: unknown): this

Asserts that the value strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected value
toHaveValueSatisfying(matcher: (value: RedisSetValue) => unknown): this

Asserts that the value satisfies the provided matcher function.

Parameters
  • matcher(value: RedisSetValue) => unknown
    • A function that receives the value and performs assertions
toHaveValueContaining(substr: string): this

Asserts that the value contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveValueMatching(expected: RegExp): this

Asserts that the value matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#RedisSetResultFailure

interface RedisSetResultFailure extends RedisSetResultBase

SET result with connection failure.

NameDescription
processed
ok
error
value
Properties
interface

#RedisSetResultSuccess

interface RedisSetResultSuccess extends RedisSetResultBase

Successful SET result.

NameDescription
processed
ok
error
value
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyvalue"OK"
interface

#RedisTransaction

interface RedisTransaction

Redis transaction interface

Methods
get(key: string): this
Parameters
  • keystring
set(key: string, value: string, options?: RedisSetOptions): this
Parameters
del(_: string[]): this
Parameters
  • _string[]
incr(key: string): this
Parameters
  • keystring
decr(key: string): this
Parameters
  • keystring
hget(key: string, field: string): this
Parameters
  • keystring
  • fieldstring
hset(key: string, field: string, value: string): this
Parameters
  • keystring
  • fieldstring
  • valuestring
hgetall(key: string): this
Parameters
  • keystring
hdel(key: string, _: string[]): this
Parameters
  • keystring
  • _string[]
lpush(key: string, _: string[]): this
Parameters
  • keystring
  • _string[]
rpush(key: string, _: string[]): this
Parameters
  • keystring
  • _string[]
lpop(key: string): this
Parameters
  • keystring
rpop(key: string): this
Parameters
  • keystring
lrange(key: string, start: number, stop: number): this
Parameters
  • keystring
  • startnumber
  • stopnumber
llen(key: string): this
Parameters
  • keystring
sadd(key: string, _: string[]): this
Parameters
  • keystring
  • _string[]
srem(key: string, _: string[]): this
Parameters
  • keystring
  • _string[]
smembers(key: string): this
Parameters
  • keystring
sismember(key: string, member: string): this
Parameters
  • keystring
  • memberstring
zadd(key: string, _: { score: number; member: string }[]): this
Parameters
  • keystring
  • _{ score: number; member: string }[]
zrange(key: string, start: number, stop: number): this
Parameters
  • keystring
  • startnumber
  • stopnumber
zscore(key: string, member: string): this
Parameters
  • keystring
  • memberstring
exec(options?: RedisCommandOptions): Promise<RedisArrayResult<unknown>>
Parameters
discard(): void
interface

#ReflectionApi

interface ReflectionApi

Reflection API for ConnectRPC client. Only available when client is created with schema: "reflection".

NameDescription
enabledCheck if reflection is enabled.
listServices()List all available services on the server.
getServiceInfo()Get detailed information about a specific service.
listMethods()Get methods for a specific service.
hasService()Check if a service exists.
Properties
  • readonlyenabledboolean

    Check if reflection is enabled.

Methods
listServices(): Promise<ServiceInfo[]>

List all available services on the server.

getServiceInfo(serviceName: string): Promise<ServiceDetail>

Get detailed information about a specific service.

Parameters
  • serviceNamestring
    • Fully qualified service name (e.g., "echo.EchoService")
listMethods(serviceName: string): Promise<MethodInfo[]>

Get methods for a specific service.

Parameters
  • serviceNamestring
    • Fully qualified service name
hasService(serviceName: string): Promise<boolean>

Check if a service exists.

Parameters
  • serviceNamestring
    • Fully qualified service name
interface

#ServiceDetail

interface ServiceDetail

Detailed service information.

NameDescription
nameService name
fullNameFully qualified service name
packageNamePackage name
protoFileProto file name
methodsAll methods
Properties
  • readonlynamestring

    Service name

  • readonlyfullNamestring

    Fully qualified service name

  • readonlypackageNamestring

    Package name

  • readonlyprotoFilestring

    Proto file name

  • readonlymethodsreadonly MethodInfo[]

    All methods

interface

#ServiceInfo

interface ServiceInfo

Service information from reflection.

NameDescription
nameFully qualified service name (e.g., "echo.EchoService")
fileProto file name
Properties
  • readonlynamestring

    Fully qualified service name (e.g., "echo.EchoService")

  • readonlyfilestring

    Proto file name

interface

#SqlErrorOptions

interface SqlErrorOptions extends ErrorOptions

Options for SqlError constructor.

NameDescription
sqlStateSQL State code (e.g., "23505" for unique violation)
Properties
  • readonlysqlState?string

    SQL State code (e.g., "23505" for unique violation)

interface

#SqlQueryOptions

interface SqlQueryOptions extends CommonOptions

Options for individual SQL queries.

NameDescription
throwOnErrorWhether to throw an error for query failures.
Properties
  • readonlythrowOnError?boolean

    Whether to throw an error for query failures. When false, failures are returned as SqlQueryResultError or SqlQueryResultFailure.

interface

#SqlQueryResultError

interface SqlQueryResultError<T = any> extends SqlQueryResultBase<T>

SQL query result for query errors (syntax errors, constraint violations, etc.).

Server received and processed the query, but it failed due to a SQL error.

NameDescription
processedServer processed the query.
okQuery failed.
errorError describing the SQL error.
rowsEmpty rows for failed queries.
rowCountZero affected rows for failed queries.
lastInsertIdNo lastInsertId for failed queries.
warningsNo warnings for failed queries.
Properties
  • readonlyprocessedtrue

    Server processed the query.

  • readonlyokfalse

    Query failed.

  • readonlyerrorSqlError

    Error describing the SQL error.

  • readonlyrowsreadonly never[]

    Empty rows for failed queries.

  • readonlyrowCount0

    Zero affected rows for failed queries.

  • readonlylastInsertIdnull

    No lastInsertId for failed queries.

  • readonlywarningsnull

    No warnings for failed queries.

interface

#SqlQueryResultExpectation

interface SqlQueryResultExpectation

Expectation interface for SQL query results. All methods return this for chaining.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveRows()Asserts that the rows equal the expected value.
toHaveRowsEqual()Asserts that the rows equal the expected value using deep equality.
toHaveRowsStrictEqual()Asserts that the rows strictly equal the expected value.
toHaveRowsSatisfying()Asserts that the rows satisfy the provided matcher function.
toHaveRowsContaining()Asserts that the rows array contains the specified item.
toHaveRowsContainingEqual()Asserts that the rows array contains an item equal to the specified value.
toHaveRowsMatching()Asserts that the rows array matches the specified subset.
toHaveRowsEmpty()Asserts that the rows array is empty.
toHaveRowCount()Asserts that the row count equals the expected value.
toHaveRowCountEqual()Asserts that the row count equals the expected value using deep equality.
toHaveRowCountStrictEqual()Asserts that the row count strictly equals the expected value.
toHaveRowCountSatisfying()Asserts that the row count satisfies the provided matcher function.
toHaveRowCountNaN()Asserts that the row count is NaN.
toHaveRowCountGreaterThan()Asserts that the row count is greater than the expected value.
toHaveRowCountGreaterThanOrEqual()Asserts that the row count is greater than or equal to the expected value.
toHaveRowCountLessThan()Asserts that the row count is less than the expected value.
toHaveRowCountLessThanOrEqual()Asserts that the row count is less than or equal to the expected value.
toHaveRowCountCloseTo()Asserts that the row count is close to the expected value.
toHaveLastInsertId()Asserts that the last insert ID equals the expected value.
toHaveLastInsertIdEqual()Asserts that the last insert ID equals the expected value using deep equality.
toHaveLastInsertIdStrictEqual()Asserts that the last insert ID strictly equals the expected value.
toHaveLastInsertIdSatisfying()Asserts that the last insert ID satisfies the provided matcher function.
toHaveLastInsertIdPresent()Asserts that the last insert ID is present (not null or undefined).
toHaveLastInsertIdNull()Asserts that the last insert ID is null.
toHaveLastInsertIdUndefined()Asserts that the last insert ID is undefined.
toHaveLastInsertIdNullish()Asserts that the last insert ID is nullish (null or undefined).
toHaveWarnings()Asserts that the warnings equal the expected value.
toHaveWarningsEqual()Asserts that the warnings equal the expected value using deep equality.
toHaveWarningsStrictEqual()Asserts that the warnings strictly equal the expected value.
toHaveWarningsSatisfying()Asserts that the warnings satisfy the provided matcher function.
toHaveWarningsPresent()Asserts that the warnings are present (not null or undefined).
toHaveWarningsNull()Asserts that the warnings are null.
toHaveWarningsUndefined()Asserts that the warnings are undefined.
toHaveWarningsNullish()Asserts that the warnings are nullish (null or undefined).
toHaveWarningsContaining()Asserts that the warnings array contains the specified item.
toHaveWarningsContainingEqual()Asserts that the warnings array contains an item equal to the specified value.
toHaveWarningsMatching()Asserts that the warnings array matches the specified subset.
toHaveWarningsEmpty()Asserts that the warnings array is empty.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveRows(expected: unknown): this

Asserts that the rows equal the expected value.

Parameters
  • expectedunknown
    • The expected rows value
toHaveRowsEqual(expected: unknown): this

Asserts that the rows equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected rows value
toHaveRowsStrictEqual(expected: unknown): this

Asserts that the rows strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected rows value
toHaveRowsSatisfying(matcher: (value: SqlRows) => unknown): this

Asserts that the rows satisfy the provided matcher function.

Parameters
  • matcher(value: SqlRows) => unknown
    • A function that receives the rows and performs assertions
toHaveRowsContaining(item: unknown): this

Asserts that the rows array contains the specified item.

Parameters
  • itemunknown
    • The item to search for
toHaveRowsContainingEqual(item: unknown): this

Asserts that the rows array contains an item equal to the specified value.

Parameters
  • itemunknown
    • The item to search for using deep equality
toHaveRowsMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the rows array matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveRowsEmpty(): this

Asserts that the rows array is empty.

toHaveRowCount(expected: unknown): this

Asserts that the row count equals the expected value.

Parameters
  • expectedunknown
    • The expected row count
toHaveRowCountEqual(expected: unknown): this

Asserts that the row count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected row count
toHaveRowCountStrictEqual(expected: unknown): this

Asserts that the row count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected row count
toHaveRowCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the row count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the row count and performs assertions
toHaveRowCountNaN(): this

Asserts that the row count is NaN.

toHaveRowCountGreaterThan(expected: number): this

Asserts that the row count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveRowCountGreaterThanOrEqual(expected: number): this

Asserts that the row count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveRowCountLessThan(expected: number): this

Asserts that the row count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveRowCountLessThanOrEqual(expected: number): this

Asserts that the row count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveRowCountCloseTo(expected: number, numDigits?: number): this

Asserts that the row count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveLastInsertId(expected: unknown): this

Asserts that the last insert ID equals the expected value.

Parameters
  • expectedunknown
    • The expected last insert ID
toHaveLastInsertIdEqual(expected: unknown): this

Asserts that the last insert ID equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected last insert ID
toHaveLastInsertIdStrictEqual(expected: unknown): this

Asserts that the last insert ID strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected last insert ID
toHaveLastInsertIdSatisfying(matcher: (value: any) => unknown): this

Asserts that the last insert ID satisfies the provided matcher function.

Parameters
  • matcher(value: any) => unknown
    • A function that receives the last insert ID and performs assertions
toHaveLastInsertIdPresent(): this

Asserts that the last insert ID is present (not null or undefined).

toHaveLastInsertIdNull(): this

Asserts that the last insert ID is null.

toHaveLastInsertIdUndefined(): this

Asserts that the last insert ID is undefined.

toHaveLastInsertIdNullish(): this

Asserts that the last insert ID is nullish (null or undefined).

toHaveWarnings(expected: unknown): this

Asserts that the warnings equal the expected value.

Parameters
  • expectedunknown
    • The expected warnings value
toHaveWarningsEqual(expected: unknown): this

Asserts that the warnings equal the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected warnings value
toHaveWarningsStrictEqual(expected: unknown): this

Asserts that the warnings strictly equal the expected value.

Parameters
  • expectedunknown
    • The expected warnings value
toHaveWarningsSatisfying(matcher: (value: SqlWarnings) => unknown): this

Asserts that the warnings satisfy the provided matcher function.

Parameters
  • matcher(value: SqlWarnings) => unknown
    • A function that receives the warnings and performs assertions
toHaveWarningsPresent(): this

Asserts that the warnings are present (not null or undefined).

toHaveWarningsNull(): this

Asserts that the warnings are null.

toHaveWarningsUndefined(): this

Asserts that the warnings are undefined.

toHaveWarningsNullish(): this

Asserts that the warnings are nullish (null or undefined).

toHaveWarningsContaining(item: unknown): this

Asserts that the warnings array contains the specified item.

Parameters
  • itemunknown
    • The item to search for
toHaveWarningsContainingEqual(item: unknown): this

Asserts that the warnings array contains an item equal to the specified value.

Parameters
  • itemunknown
    • The item to search for using deep equality
toHaveWarningsMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the warnings array matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveWarningsEmpty(): this

Asserts that the warnings array is empty.

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#SqlQueryResultFailure

interface SqlQueryResultFailure<T = any> extends SqlQueryResultBase<T>

SQL query result for connection failures (network errors, timeouts, etc.).

Query could not be processed by the server (connection refused, timeout, pool exhausted, authentication failure, etc.).

NameDescription
processedServer did not process the query.
okQuery failed.
errorError describing the failure.
rowsNo rows (query didn't reach server).
rowCountNo row count (query didn't reach server).
lastInsertIdNo lastInsertId (query didn't reach server).
warningsNo warnings (query didn't reach server).
Properties
  • readonlyprocessedfalse

    Server did not process the query.

  • readonlyokfalse

    Query failed.

  • readonlyerrorSqlFailureError

    Error describing the failure.

  • readonlyrowsnull

    No rows (query didn't reach server).

  • readonlyrowCountnull

    No row count (query didn't reach server).

  • readonlylastInsertIdnull

    No lastInsertId (query didn't reach server).

  • readonlywarningsnull

    No warnings (query didn't reach server).

interface

#SqlQueryResultSuccess

interface SqlQueryResultSuccess<T = any> extends SqlQueryResultBase<T>

SQL query result for successful queries.

The query was executed successfully and returned results.

NameDescription
processedServer processed the query.
okQuery succeeded.
errorNo error for successful queries.
rowsQuery result rows.
rowCountNumber of affected rows.
lastInsertIdLast inserted ID (for INSERT statements).
warningsWarning messages from the database.
Properties
  • readonlyprocessedtrue

    Server processed the query.

  • readonlyoktrue

    Query succeeded.

  • readonlyerrornull

    No error for successful queries.

  • readonlyrowsreadonly T[]

    Query result rows.

  • readonlyrowCountnumber

    Number of affected rows.

  • readonlylastInsertIdbigint | string | null

    Last inserted ID (for INSERT statements).

  • readonlywarningsunknown | null

    Warning messages from the database.

interface

#SqlQueryResultSuccessParams

interface SqlQueryResultSuccessParams<T = any>

Parameters for creating a SqlQueryResultSuccess.

NameDescription
rowsThe result rows
rowCountNumber of affected rows (for INSERT/UPDATE/DELETE)
durationQuery execution duration in milliseconds
lastInsertIdLast inserted ID (for INSERT statements)
warningsWarning messages from the database
Properties
  • readonlyrowsreadonly T[]

    The result rows

  • readonlyrowCountnumber

    Number of affected rows (for INSERT/UPDATE/DELETE)

  • readonlydurationnumber

    Query execution duration in milliseconds

  • readonlylastInsertId?bigint | string

    Last inserted ID (for INSERT statements)

  • readonlywarnings?readonly string[]

    Warning messages from the database

interface

#SqlTransaction

interface SqlTransaction

SQL transaction interface. Implementations should provide actual database-specific transaction handling.

NameDescription
query()Execute a query within the transaction.
queryOne()Execute a query and return the first row or undefined.
commit()Commit the transaction.
rollback()Rollback the transaction.
Methods
query<T = Record<string, any>>(
  sql: string,
  params?: unknown[],
  options?: SqlQueryOptions,
): Promise<SqlQueryResult<T>>

Execute a query within the transaction.

Parameters
  • sqlstring
    • SQL query string
  • params?unknown[]
    • Optional query parameters
    • Optional query options
queryOne<T = Record<string, any>>(
  sql: string,
  params?: unknown[],
  options?: SqlQueryOptions,
): Promise<T | undefined>

Execute a query and return the first row or undefined.

Parameters
  • sqlstring
    • SQL query string
  • params?unknown[]
    • Optional query parameters
    • Optional query options
commit(): Promise<void>

Commit the transaction.

rollback(): Promise<void>

Rollback the transaction.

interface

#SqlTransactionOptions

interface SqlTransactionOptions

Options for starting a transaction.

NameDescription
isolationLevelIsolation level for the transaction
Properties
interface

#SqsBatchFailedEntry

interface SqsBatchFailedEntry

Failed batch entry.

NameDescription
id
code
message
Properties
  • readonlyidstring
  • readonlycodestring
  • readonlymessagestring
interface

#SqsBatchMessage

interface SqsBatchMessage

Batch message for sendBatch.

NameDescription
id
body
delaySeconds
messageAttributes
Properties
  • readonlyidstring
  • readonlybodystring
  • readonlydelaySeconds?number
  • readonlymessageAttributes?Record<string, SqsMessageAttribute>
interface

#SqsBatchOptions

interface SqsBatchOptions extends SqsOptions

Options for batch operations.

interface

#SqsBatchSuccessEntry

interface SqsBatchSuccessEntry

Successful batch send entry.

NameDescription
messageId
id
Properties
  • readonlymessageIdstring
  • readonlyidstring
interface

#SqsClient

interface SqsClient extends AsyncDisposable

SQS client interface.

NameDescription
config
queueUrlThe current queue URL.
setQueueUrl()Set the queue URL for subsequent operations.
ensureQueue()Ensure a queue exists.
deleteQueue()Delete a queue by URL.
send()Send a message to the queue.
sendBatch()Send multiple messages to the queue in a single request.
receive()Receive messages from the queue.
delete()Delete a message from the queue.
deleteBatch()Delete multiple messages from the queue in a single request.
purge()Purge all messages from the queue.
close()Close the client and release resources.
Properties
  • readonlyconfigSqsClientConfig
  • readonlyqueueUrlstring | undefined

    The current queue URL. Can be set via config, ensureQueue(), or setQueueUrl().

Methods
setQueueUrl(queueUrl: string): void

Set the queue URL for subsequent operations.

Parameters
  • queueUrlstring
ensureQueue(
  queueName: string,
  options?: SqsEnsureQueueOptions,
): Promise<SqsEnsureQueueResult>

Ensure a queue exists. Creates the queue if it doesn't exist. If the queue already exists with the same attributes, returns the existing queue URL. Also sets the queue URL for subsequent operations.

Parameters
deleteQueue(
  queueUrl: string,
  options?: SqsDeleteQueueOptions,
): Promise<SqsDeleteQueueResult>

Delete a queue by URL.

Parameters
send(body: string, options?: SqsSendOptions): Promise<SqsSendResult>

Send a message to the queue.

Parameters
sendBatch(
  messages: SqsBatchMessage[],
  options?: SqsBatchOptions,
): Promise<SqsSendBatchResult>

Send multiple messages to the queue in a single request.

Parameters
receive(options?: SqsReceiveOptions): Promise<SqsReceiveResult>

Receive messages from the queue.

Parameters
delete(
  receiptHandle: string,
  options?: SqsDeleteOptions,
): Promise<SqsDeleteResult>

Delete a message from the queue.

Parameters
deleteBatch(
  receiptHandles: string[],
  options?: SqsBatchOptions,
): Promise<SqsDeleteBatchResult>

Delete multiple messages from the queue in a single request.

Parameters
purge(options?: SqsOptions): Promise<SqsDeleteResult>

Purge all messages from the queue.

Parameters
close(): Promise<void>

Close the client and release resources.

interface

#SqsClientConfig

interface SqsClientConfig extends SqsOptions

SQS client configuration.

NameDescription
regionAWS region
credentialsAWS credentials
queueUrlSQS queue URL (optional - can be set later or used with ensureQueue)
urlSQS endpoint URL (e.g., "http://localhost:4566" for LocalStack).
Properties
  • readonlyregionstring

    AWS region

  • readonlycredentials?{ accessKeyId: string; secretAccessKey: string }

    AWS credentials

  • readonlyqueueUrl?string

    SQS queue URL (optional - can be set later or used with ensureQueue)

  • readonlyurl?string | SqsConnectionConfig

    SQS endpoint URL (e.g., "http://localhost:4566" for LocalStack). Can be a string URL or a connection config object. Optional for real AWS (uses default endpoint), required for LocalStack.

interface

#SqsCommandErrorOptions

interface SqsCommandErrorOptions extends SqsErrorOptions

Options for SQS command errors.

NameDescription
operation
Properties
  • readonlyoperationstring
interface

#SqsConnectionConfig

interface SqsConnectionConfig extends CommonConnectionConfig

SQS connection configuration.

Extends CommonConnectionConfig with SQS-specific options.

NameDescription
protocolProtocol to use.
pathCustom path (for LocalStack or custom endpoints).
regionAWS region (required for AWS, optional for LocalStack).
Properties
  • readonlyprotocol?"http" | "https"

    Protocol to use.

  • readonlypath?string

    Custom path (for LocalStack or custom endpoints).

  • readonlyregion?string

    AWS region (required for AWS, optional for LocalStack).

interface

#SqsDeleteBatchResultError

interface SqsDeleteBatchResultError extends SqsDeleteBatchResultBase

Batch delete result with SQS error.

NameDescription
processed
ok
error
successful
failed
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorSqsError
  • readonlysuccessfulreadonly []
  • readonlyfailedreadonly []
interface

#SqsDeleteBatchResultExpectation

interface SqsDeleteBatchResultExpectation
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this
toHaveSuccessful(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulStrictEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulSatisfying(
  matcher: (value: SqsDeleteBatchSuccessful) => unknown,
): this
Parameters
  • matcher(value: SqsDeleteBatchSuccessful) => unknown
toHaveSuccessfulContaining(item: unknown): this
Parameters
  • itemunknown
toHaveSuccessfulContainingEqual(item: unknown): this
Parameters
  • itemunknown
toHaveSuccessfulMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this
Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
toHaveSuccessfulEmpty(): this
toHaveSuccessfulCount(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulCountEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulCountStrictEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulCountSatisfying(matcher: (value: number) => unknown): this
Parameters
  • matcher(value: number) => unknown
toHaveSuccessfulCountNaN(): this
toHaveSuccessfulCountGreaterThan(expected: number): this
Parameters
  • expectednumber
toHaveSuccessfulCountGreaterThanOrEqual(expected: number): this
Parameters
  • expectednumber
toHaveSuccessfulCountLessThan(expected: number): this
Parameters
  • expectednumber
toHaveSuccessfulCountLessThanOrEqual(expected: number): this
Parameters
  • expectednumber
toHaveSuccessfulCountCloseTo(expected: number, numDigits?: number): this
Parameters
  • expectednumber
  • numDigits?number
toHaveFailed(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedStrictEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedSatisfying(matcher: (value: SqsDeleteBatchFailed) => unknown): this
Parameters
  • matcher(value: SqsDeleteBatchFailed) => unknown
toHaveFailedContaining(item: unknown): this
Parameters
  • itemunknown
toHaveFailedContainingEqual(item: unknown): this
Parameters
  • itemunknown
toHaveFailedMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this
Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
toHaveFailedEmpty(): this
toHaveFailedCount(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedCountEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedCountStrictEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedCountSatisfying(matcher: (value: number) => unknown): this
Parameters
  • matcher(value: number) => unknown
toHaveFailedCountNaN(): this
toHaveFailedCountGreaterThan(expected: number): this
Parameters
  • expectednumber
toHaveFailedCountGreaterThanOrEqual(expected: number): this
Parameters
  • expectednumber
toHaveFailedCountLessThan(expected: number): this
Parameters
  • expectednumber
toHaveFailedCountLessThanOrEqual(expected: number): this
Parameters
  • expectednumber
toHaveFailedCountCloseTo(expected: number, numDigits?: number): this
Parameters
  • expectednumber
  • numDigits?number
toHaveDuration(expected: unknown): this
Parameters
  • expectedunknown
toHaveDurationEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveDurationStrictEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveDurationSatisfying(matcher: (value: number) => unknown): this
Parameters
  • matcher(value: number) => unknown
toHaveDurationNaN(): this
toHaveDurationGreaterThan(expected: number): this
Parameters
  • expectednumber
toHaveDurationGreaterThanOrEqual(expected: number): this
Parameters
  • expectednumber
toHaveDurationLessThan(expected: number): this
Parameters
  • expectednumber
toHaveDurationLessThanOrEqual(expected: number): this
Parameters
  • expectednumber
toHaveDurationCloseTo(expected: number, numDigits?: number): this
Parameters
  • expectednumber
  • numDigits?number
interface

#SqsDeleteBatchResultFailure

interface SqsDeleteBatchResultFailure extends SqsDeleteBatchResultBase

Batch delete result with connection failure.

NameDescription
processed
ok
error
successful
failed
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorSqsFailureError
  • readonlysuccessfulnull
  • readonlyfailednull
interface

#SqsDeleteBatchResultSuccess

interface SqsDeleteBatchResultSuccess extends SqsDeleteBatchResultBase

Successful batch delete result.

Note: ok: true even if some messages failed (partial failure). Check failed.length > 0 to detect partial failures.

NameDescription
processed
ok
error
successfulArray of message IDs that were successfully deleted.
failedArray of messages that failed to delete (may be non-empty even with ok: true).
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlysuccessfulreadonly string[]

    Array of message IDs that were successfully deleted.

  • readonlyfailedreadonly SqsBatchFailedEntry[]

    Array of messages that failed to delete (may be non-empty even with ok: true).

interface

#SqsDeleteOptions

interface SqsDeleteOptions extends SqsOptions

Options for deleting a message.

interface

#SqsDeleteQueueOptions

interface SqsDeleteQueueOptions extends SqsOptions

Options for deleting a queue.

interface

#SqsDeleteQueueResultError

interface SqsDeleteQueueResultError extends SqsDeleteQueueResultBase

Delete queue result with SQS error.

NameDescription
processed
ok
error
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorSqsError
interface

#SqsDeleteQueueResultExpectation

interface SqsDeleteQueueResultExpectation

Fluent API for SQS delete queue result validation.

Provides chainable assertions for queue deletion results. Delete queue results only have ok and duration properties.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#SqsDeleteQueueResultFailure

interface SqsDeleteQueueResultFailure extends SqsDeleteQueueResultBase

Delete queue result with connection failure.

NameDescription
processed
ok
error
Properties
interface

#SqsDeleteQueueResultSuccess

interface SqsDeleteQueueResultSuccess extends SqsDeleteQueueResultBase

Successful delete queue result.

NameDescription
processed
ok
error
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
interface

#SqsDeleteResultError

interface SqsDeleteResultError extends SqsDeleteResultBase

Delete result with SQS error.

NameDescription
processed
ok
error
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorSqsError
interface

#SqsDeleteResultExpectation

interface SqsDeleteResultExpectation

Fluent API for SQS delete result validation.

Provides chainable assertions for message deletion results. Delete results only have ok and duration properties.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#SqsDeleteResultFailure

interface SqsDeleteResultFailure extends SqsDeleteResultBase

Delete result with connection failure.

NameDescription
processed
ok
error
Properties
interface

#SqsDeleteResultSuccess

interface SqsDeleteResultSuccess extends SqsDeleteResultBase

Successful delete result.

NameDescription
processed
ok
error
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
interface

#SqsEnsureQueueOptions

interface SqsEnsureQueueOptions extends SqsOptions

Options for ensuring a queue exists.

NameDescription
attributesQueue attributes (e.g., DelaySeconds, MessageRetentionPeriod)
tagsQueue tags
Properties
  • readonlyattributes?Record<string, string>

    Queue attributes (e.g., DelaySeconds, MessageRetentionPeriod)

  • readonlytags?Record<string, string>

    Queue tags

interface

#SqsEnsureQueueResultError

interface SqsEnsureQueueResultError extends SqsEnsureQueueResultBase

Ensure queue result with SQS error.

NameDescription
processed
ok
error
queueUrl
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorSqsError
  • readonlyqueueUrlnull
interface

#SqsEnsureQueueResultExpectation

interface SqsEnsureQueueResultExpectation

Fluent API for SQS ensure queue result validation.

Provides chainable assertions for queue creation/retrieval results including queue URL.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveQueueUrl()Asserts that the queue URL equals the expected value.
toHaveQueueUrlEqual()Asserts that the queue URL equals the expected value using deep equality.
toHaveQueueUrlStrictEqual()Asserts that the queue URL strictly equals the expected value.
toHaveQueueUrlSatisfying()Asserts that the queue URL satisfies the provided matcher function.
toHaveQueueUrlContaining()Asserts that the queue URL contains the specified substring.
toHaveQueueUrlMatching()Asserts that the queue URL matches the specified regular expression.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveQueueUrl(expected: unknown): this

Asserts that the queue URL equals the expected value.

Parameters
  • expectedunknown
    • The expected queue URL
toHaveQueueUrlEqual(expected: unknown): this

Asserts that the queue URL equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected queue URL
toHaveQueueUrlStrictEqual(expected: unknown): this

Asserts that the queue URL strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected queue URL
toHaveQueueUrlSatisfying(matcher: (value: string) => unknown): this

Asserts that the queue URL satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the queue URL and performs assertions
toHaveQueueUrlContaining(substr: string): this

Asserts that the queue URL contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveQueueUrlMatching(expected: RegExp): this

Asserts that the queue URL matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#SqsEnsureQueueResultFailure

interface SqsEnsureQueueResultFailure extends SqsEnsureQueueResultBase

Ensure queue result with connection failure.

NameDescription
processed
ok
error
queueUrl
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorSqsFailureError
  • readonlyqueueUrlnull
interface

#SqsEnsureQueueResultSuccess

interface SqsEnsureQueueResultSuccess extends SqsEnsureQueueResultBase

Successful ensure queue result.

NameDescription
processed
ok
error
queueUrlURL of the queue (existing or newly created).
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlyqueueUrlstring

    URL of the queue (existing or newly created).

interface

#SqsErrorOptions

interface SqsErrorOptions extends ErrorOptions

Options for SQS errors.

NameDescription
code
Properties
  • readonlycode?string
interface

#SqsMessage

interface SqsMessage

SQS message received from a queue.

Properties
  • readonlymessageIdstring
  • readonlybodystring
  • readonlyreceiptHandlestring
  • readonlyattributesRecord<string, string>
  • readonlymessageAttributes?Record<string, SqsMessageAttribute>
  • readonlymd5OfBodystring
interface

#SqsMessageAttribute

interface SqsMessageAttribute

SQS message attributes.

NameDescription
dataType
stringValue
binaryValue
Properties
  • readonlydataType"String" | "Number" | "Binary"
  • readonlystringValue?string
  • readonlybinaryValue?Uint8Array
interface

#SqsOptions

interface SqsOptions extends CommonOptions

Common options with throwOnError support.

NameDescription
throwOnErrorIf true, throws errors instead of returning them in the result.
Properties
  • readonlythrowOnError?boolean

    If true, throws errors instead of returning them in the result. If false (default), errors are returned in the result object.

interface

#SqsReceiveOptions

interface SqsReceiveOptions extends SqsOptions

Options for receiving messages.

NameDescription
maxMessagesMaximum number of messages to receive (1-10, default: 1)
waitTimeSecondsWait time in seconds for long polling (0-20)
visibilityTimeoutVisibility timeout in seconds (0-43200)
attributeNamesSystem attribute names to retrieve
messageAttributeNamesMessage attribute names to retrieve
Properties
  • readonlymaxMessages?number

    Maximum number of messages to receive (1-10, default: 1)

  • readonlywaitTimeSeconds?number

    Wait time in seconds for long polling (0-20)

  • readonlyvisibilityTimeout?number

    Visibility timeout in seconds (0-43200)

  • readonlyattributeNames?readonly string[]

    System attribute names to retrieve

  • readonlymessageAttributeNames?readonly string[]

    Message attribute names to retrieve

interface

#SqsReceiveResultError

interface SqsReceiveResultError extends SqsReceiveResultBase

Receive result with SQS error.

NameDescription
processed
ok
error
messages
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorSqsError
  • readonlymessagesreadonly []
interface

#SqsReceiveResultExpectation

interface SqsReceiveResultExpectation

Fluent API for SQS receive result validation.

Provides chainable assertions specifically designed for message receive results including messages array and message count.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveMessages()Asserts that the messages equals the expected value.
toHaveMessagesEqual()Asserts that the messages equals the expected value using deep equality.
toHaveMessagesStrictEqual()Asserts that the messages strictly equals the expected value.
toHaveMessagesSatisfying()Asserts that the messages satisfies the provided matcher function.
toHaveMessagesContaining()Asserts that the messages contains the specified item.
toHaveMessagesContainingEqual()Asserts that the messages contains an item equal to the specified value.
toHaveMessagesMatching()Asserts that the messages matches the specified subset.
toHaveMessagesEmpty()Asserts that the messages is empty.
toHaveMessagesCount()Asserts that the messages count equals the expected value.
toHaveMessagesCountEqual()Asserts that the messages count equals the expected value using deep equality.
toHaveMessagesCountStrictEqual()Asserts that the messages count strictly equals the expected value.
toHaveMessagesCountSatisfying()Asserts that the messages count satisfies the provided matcher function.
toHaveMessagesCountNaN()Asserts that the messages count is NaN.
toHaveMessagesCountGreaterThan()Asserts that the messages count is greater than the expected value.
toHaveMessagesCountGreaterThanOrEqual()Asserts that the messages count is greater than or equal to the expected value.
toHaveMessagesCountLessThan()Asserts that the messages count is less than the expected value.
toHaveMessagesCountLessThanOrEqual()Asserts that the messages count is less than or equal to the expected value.
toHaveMessagesCountCloseTo()Asserts that the messages count is close to the expected value.
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveMessages(expected: unknown): this

Asserts that the messages equals the expected value.

Parameters
  • expectedunknown
    • The expected messages
toHaveMessagesEqual(expected: unknown): this

Asserts that the messages equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected messages
toHaveMessagesStrictEqual(expected: unknown): this

Asserts that the messages strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected messages
toHaveMessagesSatisfying(matcher: (value: SqsMessages) => unknown): this

Asserts that the messages satisfies the provided matcher function.

Parameters
  • matcher(value: SqsMessages) => unknown
    • A function that receives the messages and performs assertions
toHaveMessagesContaining(item: unknown): this

Asserts that the messages contains the specified item.

Parameters
  • itemunknown
    • The item to search for
toHaveMessagesContainingEqual(item: unknown): this

Asserts that the messages contains an item equal to the specified value.

Parameters
  • itemunknown
    • The item to search for using deep equality
toHaveMessagesMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this

Asserts that the messages matches the specified subset.

Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
    • The subset to match against
toHaveMessagesEmpty(): this

Asserts that the messages is empty.

toHaveMessagesCount(expected: unknown): this

Asserts that the messages count equals the expected value.

Parameters
  • expectedunknown
    • The expected messages count
toHaveMessagesCountEqual(expected: unknown): this

Asserts that the messages count equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected messages count
toHaveMessagesCountStrictEqual(expected: unknown): this

Asserts that the messages count strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected messages count
toHaveMessagesCountSatisfying(matcher: (value: number) => unknown): this

Asserts that the messages count satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the messages count and performs assertions
toHaveMessagesCountNaN(): this

Asserts that the messages count is NaN.

toHaveMessagesCountGreaterThan(expected: number): this

Asserts that the messages count is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMessagesCountGreaterThanOrEqual(expected: number): this

Asserts that the messages count is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMessagesCountLessThan(expected: number): this

Asserts that the messages count is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMessagesCountLessThanOrEqual(expected: number): this

Asserts that the messages count is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveMessagesCountCloseTo(expected: number, numDigits?: number): this

Asserts that the messages count is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#SqsReceiveResultFailure

interface SqsReceiveResultFailure extends SqsReceiveResultBase

Receive result with connection failure.

NameDescription
processed
ok
error
messages
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorSqsFailureError
  • readonlymessagesnull
interface

#SqsReceiveResultSuccess

interface SqsReceiveResultSuccess extends SqsReceiveResultBase

Successful receive result.

NameDescription
processed
ok
error
messagesArray of received messages (may be empty).
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlymessagesreadonly SqsMessage[]

    Array of received messages (may be empty).

interface

#SqsSendBatchResultError

interface SqsSendBatchResultError extends SqsSendBatchResultBase

Batch send result with SQS error.

NameDescription
processed
ok
error
successful
failed
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorSqsError
  • readonlysuccessfulreadonly []
  • readonlyfailedreadonly []
interface

#SqsSendBatchResultExpectation

interface SqsSendBatchResultExpectation

Fluent API for SQS send batch result validation.

Provides chainable assertions specifically designed for batch message send results including successful and failed messages arrays.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveSuccessful()
toHaveSuccessfulEqual()
toHaveSuccessfulStrictEqual()
toHaveSuccessfulSatisfying()
toHaveSuccessfulContaining()
toHaveSuccessfulContainingEqual()
toHaveSuccessfulMatching()
toHaveSuccessfulEmpty()
toHaveSuccessfulCount()
toHaveSuccessfulCountEqual()
toHaveSuccessfulCountStrictEqual()
toHaveSuccessfulCountSatisfying()
toHaveSuccessfulCountNaN()
toHaveSuccessfulCountGreaterThan()
toHaveSuccessfulCountGreaterThanOrEqual()
toHaveSuccessfulCountLessThan()
toHaveSuccessfulCountLessThanOrEqual()
toHaveSuccessfulCountCloseTo()
toHaveFailed()
toHaveFailedEqual()
toHaveFailedStrictEqual()
toHaveFailedSatisfying()
toHaveFailedContaining()
toHaveFailedContainingEqual()
toHaveFailedMatching()
toHaveFailedEmpty()
toHaveFailedCount()
toHaveFailedCountEqual()
toHaveFailedCountStrictEqual()
toHaveFailedCountSatisfying()
toHaveFailedCountNaN()
toHaveFailedCountGreaterThan()
toHaveFailedCountGreaterThanOrEqual()
toHaveFailedCountLessThan()
toHaveFailedCountLessThanOrEqual()
toHaveFailedCountCloseTo()
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveSuccessful(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulStrictEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulSatisfying(
  matcher: (value: SqsSendBatchSuccessful) => unknown,
): this
Parameters
  • matcher(value: SqsSendBatchSuccessful) => unknown
toHaveSuccessfulContaining(item: unknown): this
Parameters
  • itemunknown
toHaveSuccessfulContainingEqual(item: unknown): this
Parameters
  • itemunknown
toHaveSuccessfulMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this
Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
toHaveSuccessfulEmpty(): this
toHaveSuccessfulCount(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulCountEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulCountStrictEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveSuccessfulCountSatisfying(matcher: (value: number) => unknown): this
Parameters
  • matcher(value: number) => unknown
toHaveSuccessfulCountNaN(): this
toHaveSuccessfulCountGreaterThan(expected: number): this
Parameters
  • expectednumber
toHaveSuccessfulCountGreaterThanOrEqual(expected: number): this
Parameters
  • expectednumber
toHaveSuccessfulCountLessThan(expected: number): this
Parameters
  • expectednumber
toHaveSuccessfulCountLessThanOrEqual(expected: number): this
Parameters
  • expectednumber
toHaveSuccessfulCountCloseTo(expected: number, numDigits?: number): this
Parameters
  • expectednumber
  • numDigits?number
toHaveFailed(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedStrictEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedSatisfying(matcher: (value: SqsSendBatchFailed) => unknown): this
Parameters
  • matcher(value: SqsSendBatchFailed) => unknown
toHaveFailedContaining(item: unknown): this
Parameters
  • itemunknown
toHaveFailedContainingEqual(item: unknown): this
Parameters
  • itemunknown
toHaveFailedMatching(
  subset: Record<PropertyKey, unknown> | Record<PropertyKey, unknown>[],
): this
Parameters
  • subsetRecord<PropertyKey, unknown> | Record<PropertyKey, unknown>[]
toHaveFailedEmpty(): this
toHaveFailedCount(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedCountEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedCountStrictEqual(expected: unknown): this
Parameters
  • expectedunknown
toHaveFailedCountSatisfying(matcher: (value: number) => unknown): this
Parameters
  • matcher(value: number) => unknown
toHaveFailedCountNaN(): this
toHaveFailedCountGreaterThan(expected: number): this
Parameters
  • expectednumber
toHaveFailedCountGreaterThanOrEqual(expected: number): this
Parameters
  • expectednumber
toHaveFailedCountLessThan(expected: number): this
Parameters
  • expectednumber
toHaveFailedCountLessThanOrEqual(expected: number): this
Parameters
  • expectednumber
toHaveFailedCountCloseTo(expected: number, numDigits?: number): this
Parameters
  • expectednumber
  • numDigits?number
toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#SqsSendBatchResultFailure

interface SqsSendBatchResultFailure extends SqsSendBatchResultBase

Batch send result with connection failure.

NameDescription
processed
ok
error
successful
failed
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorSqsFailureError
  • readonlysuccessfulnull
  • readonlyfailednull
interface

#SqsSendBatchResultSuccess

interface SqsSendBatchResultSuccess extends SqsSendBatchResultBase

Successful batch send result.

Note: ok: true even if some messages failed (partial failure). Check failed.length > 0 to detect partial failures.

NameDescription
processed
ok
error
successfulArray of successfully sent messages.
failedArray of messages that failed to send (may be non-empty even with ok: true).
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlysuccessfulreadonly SqsBatchSuccessEntry[]

    Array of successfully sent messages.

  • readonlyfailedreadonly SqsBatchFailedEntry[]

    Array of messages that failed to send (may be non-empty even with ok: true).

interface

#SqsSendOptions

interface SqsSendOptions extends SqsOptions

Options for sending a message.

NameDescription
delaySecondsDelay in seconds before the message becomes visible (0-900)
messageAttributesMessage attributes
messageGroupIdMessage group ID (required for FIFO queues)
messageDeduplicationIdMessage deduplication ID (required for FIFO queues without content-based deduplication)
Properties
  • readonlydelaySeconds?number

    Delay in seconds before the message becomes visible (0-900)

  • readonlymessageAttributes?Record<string, SqsMessageAttribute>

    Message attributes

  • readonlymessageGroupId?string

    Message group ID (required for FIFO queues)

  • readonlymessageDeduplicationId?string

    Message deduplication ID (required for FIFO queues without content-based deduplication)

interface

#SqsSendResultError

interface SqsSendResultError extends SqsSendResultBase

Send result with SQS error.

NameDescription
processed
ok
error
messageId
md5OfBody
sequenceNumber
Properties
  • readonlyprocessedtrue
  • readonlyokfalse
  • readonlyerrorSqsError
  • readonlymessageIdnull
  • readonlymd5OfBodynull
  • readonlysequenceNumbernull
interface

#SqsSendResultExpectation

interface SqsSendResultExpectation

Fluent API for SQS send result validation.

Provides chainable assertions specifically designed for single message send results including message ID and sequence number.

NameDescription
notNegates the next assertion.
toBeOk()Asserts that the result is successful.
toHaveMessageId()Asserts that the message ID equals the expected value.
toHaveMessageIdEqual()Asserts that the message ID equals the expected value using deep equality.
toHaveMessageIdStrictEqual()Asserts that the message ID strictly equals the expected value.
toHaveMessageIdSatisfying()Asserts that the message ID satisfies the provided matcher function.
toHaveMessageIdContaining()Asserts that the message ID contains the specified substring.
toHaveMessageIdMatching()Asserts that the message ID matches the specified regular expression.
toHaveMd5OfBody()Asserts that the MD5 of body equals the expected value.
toHaveMd5OfBodyEqual()Asserts that the MD5 of body equals the expected value using deep equality.
toHaveMd5OfBodyStrictEqual()Asserts that the MD5 of body strictly equals the expected value.
toHaveMd5OfBodySatisfying()Asserts that the MD5 of body satisfies the provided matcher function.
toHaveMd5OfBodyContaining()Asserts that the MD5 of body contains the specified substring.
toHaveMd5OfBodyMatching()Asserts that the MD5 of body matches the specified regular expression.
toHaveSequenceNumber()Asserts that the sequence number equals the expected value.
toHaveSequenceNumberEqual()Asserts that the sequence number equals the expected value using deep equality.
toHaveSequenceNumberStrictEqual()Asserts that the sequence number strictly equals the expected value.
toHaveSequenceNumberSatisfying()Asserts that the sequence number satisfies the provided matcher function.
toHaveSequenceNumberContaining()Asserts that the sequence number contains the specified substring.
toHaveSequenceNumberMatching()Asserts that the sequence number matches the specified regular expression.
toHaveSequenceNumberPresent()Asserts that the sequence number is present (not null or undefined).
toHaveSequenceNumberNull()Asserts that the sequence number is null.
toHaveSequenceNumberUndefined()Asserts that the sequence number is undefined.
toHaveSequenceNumberNullish()Asserts that the sequence number is nullish (null or undefined).
toHaveDuration()Asserts that the duration equals the expected value.
toHaveDurationEqual()Asserts that the duration equals the expected value using deep equality.
toHaveDurationStrictEqual()Asserts that the duration strictly equals the expected value.
toHaveDurationSatisfying()Asserts that the duration satisfies the provided matcher function.
toHaveDurationNaN()Asserts that the duration is NaN.
toHaveDurationGreaterThan()Asserts that the duration is greater than the expected value.
toHaveDurationGreaterThanOrEqual()Asserts that the duration is greater than or equal to the expected value.
toHaveDurationLessThan()Asserts that the duration is less than the expected value.
toHaveDurationLessThanOrEqual()Asserts that the duration is less than or equal to the expected value.
toHaveDurationCloseTo()Asserts that the duration is close to the expected value.
Properties
  • readonlynotthis

    Negates the next assertion.

Methods
toBeOk(): this

Asserts that the result is successful.

toHaveMessageId(expected: unknown): this

Asserts that the message ID equals the expected value.

Parameters
  • expectedunknown
    • The expected message ID
toHaveMessageIdEqual(expected: unknown): this

Asserts that the message ID equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected message ID
toHaveMessageIdStrictEqual(expected: unknown): this

Asserts that the message ID strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected message ID
toHaveMessageIdSatisfying(matcher: (value: string) => unknown): this

Asserts that the message ID satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the message ID and performs assertions
toHaveMessageIdContaining(substr: string): this

Asserts that the message ID contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveMessageIdMatching(expected: RegExp): this

Asserts that the message ID matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveMd5OfBody(expected: unknown): this

Asserts that the MD5 of body equals the expected value.

Parameters
  • expectedunknown
    • The expected MD5 hash
toHaveMd5OfBodyEqual(expected: unknown): this

Asserts that the MD5 of body equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected MD5 hash
toHaveMd5OfBodyStrictEqual(expected: unknown): this

Asserts that the MD5 of body strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected MD5 hash
toHaveMd5OfBodySatisfying(matcher: (value: string) => unknown): this

Asserts that the MD5 of body satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the MD5 hash and performs assertions
toHaveMd5OfBodyContaining(substr: string): this

Asserts that the MD5 of body contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveMd5OfBodyMatching(expected: RegExp): this

Asserts that the MD5 of body matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveSequenceNumber(expected: unknown): this

Asserts that the sequence number equals the expected value.

Parameters
  • expectedunknown
    • The expected sequence number
toHaveSequenceNumberEqual(expected: unknown): this

Asserts that the sequence number equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected sequence number
toHaveSequenceNumberStrictEqual(expected: unknown): this

Asserts that the sequence number strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected sequence number
toHaveSequenceNumberSatisfying(matcher: (value: string) => unknown): this

Asserts that the sequence number satisfies the provided matcher function.

Parameters
  • matcher(value: string) => unknown
    • A function that receives the sequence number and performs assertions
toHaveSequenceNumberContaining(substr: string): this

Asserts that the sequence number contains the specified substring.

Parameters
  • substrstring
    • The substring to search for
toHaveSequenceNumberMatching(expected: RegExp): this

Asserts that the sequence number matches the specified regular expression.

Parameters
  • expectedRegExp
    • The regular expression to match against
toHaveSequenceNumberPresent(): this

Asserts that the sequence number is present (not null or undefined).

toHaveSequenceNumberNull(): this

Asserts that the sequence number is null.

toHaveSequenceNumberUndefined(): this

Asserts that the sequence number is undefined.

toHaveSequenceNumberNullish(): this

Asserts that the sequence number is nullish (null or undefined).

toHaveDuration(expected: unknown): this

Asserts that the duration equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationEqual(expected: unknown): this

Asserts that the duration equals the expected value using deep equality.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationStrictEqual(expected: unknown): this

Asserts that the duration strictly equals the expected value.

Parameters
  • expectedunknown
    • The expected duration value
toHaveDurationSatisfying(matcher: (value: number) => unknown): this

Asserts that the duration satisfies the provided matcher function.

Parameters
  • matcher(value: number) => unknown
    • A function that receives the duration and performs assertions
toHaveDurationNaN(): this

Asserts that the duration is NaN.

toHaveDurationGreaterThan(expected: number): this

Asserts that the duration is greater than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationGreaterThanOrEqual(expected: number): this

Asserts that the duration is greater than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThan(expected: number): this

Asserts that the duration is less than the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationLessThanOrEqual(expected: number): this

Asserts that the duration is less than or equal to the expected value.

Parameters
  • expectednumber
    • The value to compare against
toHaveDurationCloseTo(expected: number, numDigits?: number): this

Asserts that the duration is close to the expected value.

Parameters
  • expectednumber
    • The expected value
  • numDigits?number
    • The number of decimal digits to check (default: 2)
interface

#SqsSendResultFailure

interface SqsSendResultFailure extends SqsSendResultBase

Send result with connection failure.

NameDescription
processed
ok
error
messageId
md5OfBody
sequenceNumber
Properties
  • readonlyprocessedfalse
  • readonlyokfalse
  • readonlyerrorSqsFailureError
  • readonlymessageIdnull
  • readonlymd5OfBodynull
  • readonlysequenceNumbernull
interface

#SqsSendResultSuccess

interface SqsSendResultSuccess extends SqsSendResultBase

Successful send result.

NameDescription
processed
ok
error
messageIdUnique identifier for the sent message.
md5OfBodyMD5 hash of the message body (for integrity verification).
sequenceNumberSequence number for FIFO queues (present only for FIFO queues).
Properties
  • readonlyprocessedtrue
  • readonlyoktrue
  • readonlyerrornull
  • readonlymessageIdstring

    Unique identifier for the sent message.

  • readonlymd5OfBodystring

    MD5 hash of the message body (for integrity verification).

  • readonlysequenceNumberstring | null

    Sequence number for FIFO queues (present only for FIFO queues).

interface

#TlsConfig

interface TlsConfig

TLS configuration for ConnectRPC connections.

NameDescription
rootCertsRoot CA certificate (PEM format).
clientCertClient certificate (PEM format).
clientKeyClient private key (PEM format).
insecureSkip server certificate verification (use only for testing).
Properties
  • readonlyrootCerts?Uint8Array

    Root CA certificate (PEM format).

  • readonlyclientCert?Uint8Array

    Client certificate (PEM format).

  • readonlyclientKey?Uint8Array

    Client private key (PEM format).

  • readonlyinsecure?boolean

    Skip server certificate verification (use only for testing).

Functions

function

#createConnectRpcClient

function createConnectRpcClient(
  config: ConnectRpcClientConfig,
): ConnectRpcClient

Create a new ConnectRPC client instance.

The client supports multiple protocols (Connect, gRPC, gRPC-Web) and provides Server Reflection for runtime service discovery without compile-time code generation.

Parameters
Returns

ConnectRpcClient — A new ConnectRPC client instance

Examples

Basic usage with reflection

import { createConnectRpcClient } from "@probitas/client-connectrpc";

const client = createConnectRpcClient({
  url: "http://localhost:50051",
});

// Call a method
const response = await client.call(
  "echo.EchoService",
  "echo",
  { message: "Hello!" }
);
console.log(response.data);

await client.close();

Service discovery with reflection

import { createConnectRpcClient } from "@probitas/client-connectrpc";

const client = createConnectRpcClient({
  url: "http://localhost:50051",
});

// Discover available services
const services = await client.reflection.listServices();
console.log("Services:", services);

// Get method information
const info = await client.reflection.getServiceInfo("echo.EchoService");
console.log("Methods:", info.methods);

await client.close();

Using different protocols

import { createConnectRpcClient } from "@probitas/client-connectrpc";

// Connect protocol (HTTP/1.1 or HTTP/2)
const connectClient = createConnectRpcClient({
  url: "http://localhost:8080",
  protocol: "connect",
});

// gRPC protocol (HTTP/2 with binary protobuf)
const grpcClient = createConnectRpcClient({
  url: "http://localhost:50051",
  protocol: "grpc",
});

// gRPC-Web protocol (for browser compatibility)
const grpcWebClient = createConnectRpcClient({
  url: "http://localhost:8080",
  protocol: "grpc-web",
});

await connectClient.close();
await grpcClient.close();
await grpcWebClient.close();

Using connection config object

import { createConnectRpcClient } from "@probitas/client-connectrpc";

const client = createConnectRpcClient({
  url: {
    host: "grpc.example.com",
    port: 443,
    protocol: "https",
  },
});

await client.close();

Using await using for automatic cleanup

import { createConnectRpcClient } from "@probitas/client-connectrpc";

await using client = createConnectRpcClient({
  url: "http://localhost:50051",
});

const res = await client.call("echo.EchoService", "echo", { message: "test" });
// Client automatically closed when scope exits
function

#createDenoKvClient

async function createDenoKvClient(
  config?: DenoKvClientConfig,
): Promise<DenoKvClient>

Create a new Deno KV client instance.

The client provides key-value operations with support for atomic transactions, time-to-live (TTL), and prefix-based listing.

Parameters
Returns

Promise<DenoKvClient> — A promise resolving to a new Deno KV client instance

Examples

Basic usage with in-memory database

import { createDenoKvClient } from "@probitas/client-deno-kv";

interface User {
  name: string;
  email: string;
}

const kv = await createDenoKvClient();

await kv.set(["users", "123"], { name: "Alice", email: "alice@example.com" });

const result = await kv.get<User>(["users", "123"]);
if (result.ok) {
  console.log(result.value);  // { name: "Alice", email: "alice@example.com" }
}

await kv.close();

Using persistent storage

import { createDenoKvClient } from "@probitas/client-deno-kv";

const kv = await createDenoKvClient({
  path: "./data.kv",
});

await kv.close();

Set with expiration (TTL)

import { createDenoKvClient } from "@probitas/client-deno-kv";

const kv = await createDenoKvClient();
const sessionId = "abc123";
const sessionData = { userId: "123", token: "xyz" };

await kv.set(["sessions", sessionId], sessionData, {
  expireIn: 3600_000,  // Expire in 1 hour
});

await kv.close();

List entries by prefix

import { createDenoKvClient } from "@probitas/client-deno-kv";

interface User {
  name: string;
  email: string;
}

const kv = await createDenoKvClient();

const result = await kv.list<User>({ prefix: ["users"] });
if (result.ok) {
  for (const entry of result.entries) {
    console.log(entry.key, entry.value);
  }
}

await kv.close();

Atomic transactions

import { createDenoKvClient } from "@probitas/client-deno-kv";

const kv = await createDenoKvClient();

const atomicResult = await kv.atomic()
  .check({ key: ["counter"], versionstamp: null })
  .set(["counter"], 1)
  .commit();

await kv.close();

Using await using for automatic cleanup

import { createDenoKvClient } from "@probitas/client-deno-kv";

await using kv = await createDenoKvClient();

await kv.set(["test"], "value");
// Client automatically closed when scope exits

Error handling with Failure pattern

import { createDenoKvClient } from "@probitas/client-deno-kv";

async function example() {
  const kv = await createDenoKvClient();

  const result = await kv.get<string>(["key"]);

  if (!result.ok) {
    if (!result.processed) {
      // Connection failure
      console.error("Connection failed:", result.error.message);
    } else {
      // KV error (quota exceeded, etc.)
      console.error("KV error:", result.error.message);
    }
    await kv.close();
    return;
  }

  console.log("Value:", result.value);
  await kv.close();
}

Using throwOnError for traditional exception handling

import { createDenoKvClient, DenoKvError } from "@probitas/client-deno-kv";

const kv = await createDenoKvClient({ throwOnError: true });

try {
  const result = await kv.get<string>(["key"]);
  console.log("Value:", result.value);
} catch (error) {
  if (error instanceof DenoKvError) {
    console.error("KV error:", error.message);
  }
}

await kv.close();
function

#createGraphqlClient

function createGraphqlClient(config: GraphqlClientConfig): GraphqlClient

Create a new GraphQL client instance.

The client provides methods for executing GraphQL queries, mutations, and subscriptions with automatic error handling and response parsing.

Parameters
Returns

GraphqlClient — A new GraphQL client instance

Examples

Basic query

import { createGraphqlClient } from "@probitas/client-graphql";

const client = createGraphqlClient({
  url: "http://localhost:4000/graphql",
});

const response = await client.query(`
  query GetUser($id: ID!) {
    user(id: $id) { id name email }
  }
`, { id: "123" });

console.log(response.data);
await client.close();

Using connection config object

import { createGraphqlClient } from "@probitas/client-graphql";

const client = createGraphqlClient({
  url: { host: "api.example.com", port: 443, protocol: "https" },
});
await client.close();

Mutation with error handling

import { createGraphqlClient } from "@probitas/client-graphql";

const client = createGraphqlClient({ url: "http://localhost:4000/graphql" });

const response = await client.mutation(`
  mutation CreateUser($input: CreateUserInput!) {
    createUser(input: $input) { id }
  }
`, { input: { name: "Alice", email: "alice@example.com" } });

if (response.ok) {
  console.log("Created user:", (response.data as any).createUser.id);
}

await client.close();

Using await using for automatic cleanup

import { createGraphqlClient } from "@probitas/client-graphql";

await using client = createGraphqlClient({
  url: "http://localhost:4000/graphql",
});
const response = await client.query(`{ __typename }`);
// Client automatically closed when scope exits
function

#createGrpcClient

function createGrpcClient(config: GrpcClientConfig): ConnectRpcClient

Create a new gRPC client instance.

This is a thin wrapper around createConnectRpcClient with protocol: "grpc" fixed. The client provides Server Reflection support for runtime service discovery.

Parameters
Returns

ConnectRpcClient — A new gRPC client instance

Examples

Basic usage with reflection

import { createGrpcClient } from "@probitas/client-grpc";

const client = createGrpcClient({
  url: "http://localhost:50051",
});

// Call a method
const response = await client.call(
  "echo.EchoService",
  "echo",
  { message: "Hello!" }
);
console.log(response.data);

await client.close();

Service discovery with reflection

import { createGrpcClient } from "@probitas/client-grpc";

const client = createGrpcClient({
  url: "http://localhost:50051",
});

// Discover available services
const services = await client.reflection.listServices();
console.log("Available services:", services);

// Get method information
const info = await client.reflection.getServiceInfo("echo.EchoService");
console.log("Methods:", info.methods);

await client.close();

Testing error responses

import { createGrpcClient } from "@probitas/client-grpc";

const client = createGrpcClient({ url: "http://localhost:50051" });

const response = await client.call(
  "user.UserService",
  "getUser",
  { id: "non-existent" },
  { throwOnError: false }
);

if (!response.ok) {
  console.log("Error code:", response.statusCode);  // NOT_FOUND = 5
}

await client.close();

Using await using for automatic cleanup

import { createGrpcClient } from "@probitas/client-grpc";

await using client = createGrpcClient({
  url: "http://localhost:50051",
});

const res = await client.call("echo.EchoService", "echo", { message: "test" });
console.log(res.data);
// Client automatically closed when scope exits
function

#createHttpClient

function createHttpClient(config: HttpClientConfig): HttpClient

Create a new HTTP client instance.

The client provides methods for making HTTP requests with automatic cookie handling, response body pre-loading, and error handling.

Parameters
Returns

HttpClient — A new HTTP client instance

Examples

Basic usage with string URL

import { createHttpClient } from "@probitas/client-http";

const http = createHttpClient({ url: "http://localhost:3000" });

const response = await http.get("/users/123");
console.log(response.json);

await http.close();

With connection config object

import { createHttpClient } from "@probitas/client-http";

const http = createHttpClient({
  url: { host: "api.example.com", port: 443, protocol: "https" },
});
await http.close();

With default headers

import { createHttpClient } from "@probitas/client-http";

const http = createHttpClient({
  url: "http://localhost:3000",
  headers: {
    "Authorization": "Bearer token123",
    "Accept": "application/json",
  },
});
await http.close();

Using await using for automatic cleanup

import { createHttpClient } from "@probitas/client-http";

await using http = createHttpClient({ url: "http://localhost:3000" });
const response = await http.get("/health");
console.log(response.ok);
function

#createMongoClient

async function createMongoClient(
  config: MongoClientConfig,
): Promise<MongoClient>

Create a new MongoDB client instance.

The client provides typed collection access, aggregation pipelines, transaction support, and comprehensive CRUD operations.

Parameters
Returns

Promise<MongoClient> — A promise resolving to a new MongoDB client instance

Examples

Basic usage with connection string

import { createMongoClient } from "@probitas/client-mongodb";

const mongo = await createMongoClient({
  url: "mongodb://localhost:27017",
  database: "testdb",
});

const users = mongo.collection<{ name: string; age: number }>("users");
const result = await users.find({ age: { $gte: 18 } });

if (result.ok) {
  console.log(result.docs[0]);
} else {
  console.error("Error:", result.error.message);
}

await mongo.close();

Using connection config object

import { createMongoClient } from "@probitas/client-mongodb";

const mongo = await createMongoClient({
  url: {
    host: "localhost",
    port: 27017,
    username: "admin",
    password: "secret",
    authSource: "admin",
  },
  database: "testdb",
});

await mongo.close();

Insert and query documents

import { createMongoClient } from "@probitas/client-mongodb";

interface User { name: string; age: number }

const mongo = await createMongoClient({
  url: "mongodb://localhost:27017",
  database: "testdb",
});
const users = mongo.collection<User>("users");

// Insert a document
const insertResult = await users.insertOne({ name: "Alice", age: 30 });
if (insertResult.ok) {
  console.log("Inserted ID:", insertResult.insertedId);
}

// Find documents with projection and sorting
const findResult = await users.find(
  { age: { $gte: 25 } },
  { sort: { name: 1 }, limit: 10 }
);
if (findResult.ok) {
  console.log("Found:", findResult.docs.length);
}

await mongo.close();

Transaction with auto-commit/rollback

import { createMongoClient } from "@probitas/client-mongodb";

interface User { _id?: unknown; name: string; age: number }

const mongo = await createMongoClient({
  url: "mongodb://localhost:27017",
  database: "testdb",
});

await mongo.transaction(async (session) => {
  const users = session.collection<User>("users");
  const insertResult = await users.insertOne({ name: "Bob", age: 25 });
  if (!insertResult.ok) throw insertResult.error;

  const updateResult = await users.updateOne(
    { name: "Alice" },
    { $inc: { age: 1 } }
  );
  if (!updateResult.ok) throw updateResult.error;
});

await mongo.close();

Aggregation pipeline

import { createMongoClient } from "@probitas/client-mongodb";

interface User { name: string; age: number; department: string }

const mongo = await createMongoClient({
  url: "mongodb://localhost:27017",
  database: "testdb",
});
const users = mongo.collection<User>("users");

const result = await users.aggregate<{ _id: string; avgAge: number }>([
  { $group: { _id: "$department", avgAge: { $avg: "$age" } } },
  { $sort: { avgAge: -1 } },
]);
if (result.ok) {
  console.log(result.docs);
}

await mongo.close();

Using await using for automatic cleanup

import { createMongoClient } from "@probitas/client-mongodb";

await using mongo = await createMongoClient({
  url: "mongodb://localhost:27017",
  database: "testdb",
});

const result = await mongo.collection("users").find({});
if (result.ok) {
  console.log(result.docs);
}
// Client automatically closed when scope exits
function

#createRabbitMqClient

async function createRabbitMqClient(
  config: RabbitMqClientConfig,
): Promise<RabbitMqClient>

Create a new RabbitMQ client instance.

The client provides queue and exchange management, message publishing and consumption, and acknowledgment handling via AMQP protocol.

Parameters
Returns

Promise<RabbitMqClient> — A promise resolving to a new RabbitMQ client instance

Examples

Basic usage with string URL

import { createRabbitMqClient } from "@probitas/client-rabbitmq";

const rabbit = await createRabbitMqClient({
  url: "amqp://guest:guest@localhost:5672",
});

const channel = await rabbit.channel();
await channel.assertQueue("my-queue", { durable: true });

const content = new TextEncoder().encode(JSON.stringify({ type: "ORDER" }));
await channel.sendToQueue("my-queue", content, { persistent: true });

await channel.close();
await rabbit.close();

With connection config object

import { createRabbitMqClient } from "@probitas/client-rabbitmq";

const rabbit = await createRabbitMqClient({
  url: {
    host: "localhost",
    port: 5672,
    username: "guest",
    password: "guest",
    vhost: "/",
  },
});

await rabbit.close();

Exchange and binding

import { createRabbitMqClient } from "@probitas/client-rabbitmq";

const rabbit = await createRabbitMqClient({ url: "amqp://localhost:5672" });
const channel = await rabbit.channel();

// Create exchange and queue
await channel.assertExchange("events", "topic", { durable: true });
await channel.assertQueue("user-events");
await channel.bindQueue("user-events", "events", "user.*");

// Publish to exchange
const content = new TextEncoder().encode(JSON.stringify({ id: 1 }));
await channel.publish("events", "user.created", content);

await rabbit.close();

Consuming messages

import { createRabbitMqClient } from "@probitas/client-rabbitmq";

const rabbit = await createRabbitMqClient({ url: "amqp://localhost:5672" });
const channel = await rabbit.channel();
await channel.assertQueue("my-queue");

for await (const message of channel.consume("my-queue")) {
  console.log("Received:", new TextDecoder().decode(message.content));
  await channel.ack(message);
  break;
}

await rabbit.close();

Get single message (polling)

import { createRabbitMqClient } from "@probitas/client-rabbitmq";

const rabbit = await createRabbitMqClient({ url: "amqp://localhost:5672" });
const channel = await rabbit.channel();
await channel.assertQueue("my-queue");

const result = await channel.get("my-queue");
if (result.message) {
  await channel.ack(result.message);
}

await rabbit.close();

Using await using for automatic cleanup

import { createRabbitMqClient } from "@probitas/client-rabbitmq";

await using rabbit = await createRabbitMqClient({
  url: "amqp://localhost:5672",
});

const channel = await rabbit.channel();
await channel.assertQueue("test");
// Client automatically closed when scope exits
function

#createRedisClient

async function createRedisClient(
  config: RedisClientConfig,
): Promise<RedisClient>

Create a new Redis client instance.

The client provides comprehensive Redis data structure support including strings, hashes, lists, sets, sorted sets, pub/sub, and transactions.

Parameters
Returns

Promise<RedisClient> — A promise resolving to a new Redis client instance

Examples

Using URL string

import { createRedisClient } from "@probitas/client-redis";

const client = await createRedisClient({
  url: "redis://localhost:6379/0",
});

await client.set("key", "value");
const result = await client.get("key");
if (result.ok) {
  console.log(result.value);  // "value"
}

await client.close();

Using connection config object

import { createRedisClient } from "@probitas/client-redis";

const client = await createRedisClient({
  url: {
    host: "localhost",
    port: 6379,
    password: "secret",
    db: 0,
  },
});
await client.close();

Set with expiration

import { createRedisClient } from "@probitas/client-redis";

const client = await createRedisClient({ url: "redis://localhost:6379" });
const sessionData = JSON.stringify({ userId: "123" });
const data = "temporary value";

// Set key with 1 hour TTL
await client.set("session", sessionData, { ex: 3600 });

// Set key with 5 second TTL in milliseconds
await client.set("temp", data, { px: 5000 });

await client.close();

Hash operations

import { createRedisClient } from "@probitas/client-redis";

const client = await createRedisClient({ url: "redis://localhost:6379" });

await client.hset("user:123", "name", "Alice");
await client.hset("user:123", "email", "alice@example.com");

const user = await client.hgetall("user:123");
if (user.ok) {
  console.log(user.value);  // { name: "Alice", email: "alice@example.com" }
}

await client.close();

Pub/Sub

import { createRedisClient } from "@probitas/client-redis";

const client = await createRedisClient({ url: "redis://localhost:6379" });

// Subscribe to channel (this would run indefinitely in practice)
// for await (const message of client.subscribe("events")) {
//   console.log("Received:", message.message);
// }

// Publish to channel
await client.publish("events", JSON.stringify({ type: "user.created" }));

await client.close();

Using await using for automatic cleanup

import { createRedisClient } from "@probitas/client-redis";

await using client = await createRedisClient({
  url: "redis://localhost:6379",
});

await client.set("test", "value");
// Client automatically closed when scope exits
function

#createSqsClient

function createSqsClient(config: SqsClientConfig): Promise<SqsClient>

Create a new Amazon SQS client instance.

The client provides queue management, message publishing and consumption, batch operations, and supports both standard and FIFO queues via AWS SDK.

Parameters
Returns

Promise<SqsClient> — A promise resolving to a new SQS client instance

Examples

Basic usage with existing queue

import { createSqsClient } from "@probitas/client-sqs";

async function example() {
  const sqs = await createSqsClient({
    region: "ap-northeast-1",
    queueUrl: "https://sqs.ap-northeast-1.amazonaws.com/123456789/my-queue",
    credentials: { accessKeyId: "test", secretAccessKey: "test" },
  });

  // Send a message
  const sendResult = await sqs.send(JSON.stringify({
    type: "ORDER",
    orderId: "123",
  }));

  if (sendResult.ok) {
    console.log("Message ID:", sendResult.messageId);
  } else {
    console.error("Error:", sendResult.error.message);
  }

  await sqs.close();
}

Using LocalStack for local development

import { createSqsClient } from "@probitas/client-sqs";

async function example() {
  const sqs = await createSqsClient({
    region: "us-east-1",
    url: "http://localhost:4566",
    credentials: {
      accessKeyId: "test",
      secretAccessKey: "test",
    },
  });

  // Create queue dynamically (also sets queueUrl)
  const result = await sqs.ensureQueue("test-queue");
  if (result.ok) {
    console.log(result.queueUrl);  // http://localhost:4566/000000000000/test-queue
  }

  await sqs.close();
}

Receiving messages with long polling

import { createSqsClient } from "@probitas/client-sqs";

async function example() {
  const sqs = await createSqsClient({
    region: "us-east-1",
    url: "http://localhost:4566",
    credentials: { accessKeyId: "test", secretAccessKey: "test" },
  });
  await sqs.ensureQueue("test-queue");

  // Long polling waits up to 20 seconds for messages
  const receiveResult = await sqs.receive({
    maxMessages: 10,
    waitTimeSeconds: 20,
    visibilityTimeout: 30,
  });

  if (receiveResult.ok) {
    console.log("Received:", receiveResult.messages.length);

    // Process and acknowledge messages
    for (const msg of receiveResult.messages) {
      const data = JSON.parse(msg.body);
      console.log("Processing:", data);

      // Delete after successful processing
      await sqs.delete(msg.receiptHandle);
    }
  }

  await sqs.close();
}

Batch operations for high throughput

import { createSqsClient } from "@probitas/client-sqs";

async function example() {
  const sqs = await createSqsClient({
    region: "us-east-1",
    url: "http://localhost:4566",
    credentials: { accessKeyId: "test", secretAccessKey: "test" },
  });
  await sqs.ensureQueue("test-queue");

  // Send multiple messages in a single API call
  const batchResult = await sqs.sendBatch([
    { id: "1", body: JSON.stringify({ event: "user.created", userId: "a1" }) },
    { id: "2", body: JSON.stringify({ event: "user.created", userId: "a2" }) },
    { id: "3", body: JSON.stringify({ event: "user.updated", userId: "a3" }) },
  ]);

  if (batchResult.ok) {
    console.log(`Sent: ${batchResult.successful.length}`);
    console.log(`Failed: ${batchResult.failed.length}`);
  }

  // Batch delete processed messages
  const receiveResult = await sqs.receive({ maxMessages: 10 });
  if (receiveResult.ok) {
    const handles = receiveResult.messages.map((m) => m.receiptHandle);
    await sqs.deleteBatch(handles);
  }

  await sqs.close();
}

Using await using for automatic cleanup

import { createSqsClient } from "@probitas/client-sqs";

async function example() {
  await using sqs = await createSqsClient({
    region: "us-east-1",
    url: "http://localhost:4566",
    credentials: { accessKeyId: "test", secretAccessKey: "test" },
  });

  await sqs.ensureQueue("test-queue");
  await sqs.send("Hello, SQS!");
  // Client automatically closed when scope exits
}
function

#expect(11 overloads)

function expect<T extends HttpResponse>(
  value: NotAny<T>,
): HttpResponseExpectation

Unified expect function that dispatches to the appropriate expectation function based on the type of the input object.

Parameters
  • valueNotAny<T>
Examples
import { expect } from "./expect.ts";

// Falls back to expectAnything (chainable @std/expect) for other values
expect(42).toBe(42).toBeGreaterThan(40);
expect("hello world").toContain("world");
expect({ a: 1, b: 2 }).toMatchObject({ a: 1 });
Show all 11 overloads
#1
function expect<T extends HttpResponse>(
  value: NotAny<T>,
): HttpResponseExpectation

Unified expect function that dispatches to the appropriate expectation function based on the type of the input object.

Parameters
  • valueNotAny<T>
#2
function expect<T extends ConnectRpcResponse>(
  value: NotAny<T>,
): ConnectRpcResponseExpectation
Parameters
  • valueNotAny<T>
#3
function expect<T extends GraphqlResponse>(
  value: NotAny<T>,
): GraphqlResponseExpectation
Parameters
  • valueNotAny<T>
#4
function expect<T extends SqlQueryResult>(
  value: NotAny<T>,
): SqlQueryResultExpectation
Parameters
  • valueNotAny<T>
#5
function expect<T extends DenoKvResult>(value: NotAny<T>): DenoKvExpectation<T>
Parameters
  • valueNotAny<T>
#6
function expect<T extends RedisResult>(value: NotAny<T>): RedisExpectation<T>
Parameters
  • valueNotAny<T>
#7
function expect<T extends MongoResult>(value: NotAny<T>): MongoExpectation<T>
Parameters
  • valueNotAny<T>
#8
function expect<T extends RabbitMqResult>(
  value: NotAny<T>,
): RabbitMqExpectation<T>
Parameters
  • valueNotAny<T>
#9
function expect<T extends SqsResult>(value: NotAny<T>): SqsExpectation<T>
Parameters
  • valueNotAny<T>
#10
function expect(value: any): AnythingExpectation
Parameters
  • valueany
#11
function expect(value: unknown): unknown
Parameters
  • valueunknown
function

#expectAnything

function expectAnything<T>(value: T): AnythingExpectation

Creates a chainable expectation for any value using @std/expect matchers.

This wrapper allows method chaining, unlike @std/expect which returns void.

Parameters
  • valueT
    • Value to test
Returns

AnythingExpectation — Chainable expectation interface

Examples
import { expectAnything } from "@probitas/expect";

// Method chaining
expectAnything(42)
  .toBeDefined()
  .toBeGreaterThan(40)
  .toBeLessThan(50);

// Negation with continued chaining
expectAnything("hello")
  .not.toBe("world")
  .not.toBeNull()
  .toContain("ello");
function

#expectConnectRpcResponse

function expectConnectRpcResponse(
  response: ConnectRpcResponse,
): ConnectRpcResponseExpectation
Parameters
function

#expectDenoKvResult

function expectDenoKvResult<R extends DenoKvResult>(
  result: R,
): DenoKvExpectation<R>

Create a fluent expectation chain for any Deno KV result validation.

This unified function accepts any Deno KV result type and returns the appropriate expectation interface based on the result's type discriminator.

Parameters
  • resultR
Examples
import type { DenoKvGetResult, DenoKvSetResult, DenoKvListResult, DenoKvDeleteResult, DenoKvAtomicResult } from "@probitas/client-deno-kv";
import { expectDenoKvResult } from "./deno_kv.ts";

// For GET result - returns DenoKvGetResultExpectation<T>
const getResult = {
  kind: "deno-kv:get",
  ok: true,
  key: ["users", "1"],
  value: { name: "Alice" },
  versionstamp: "00000000000000010000",
  duration: 0,
} as unknown as DenoKvGetResult<{ name: string }>;
expectDenoKvResult(getResult).toBeOk().toHaveValuePresent();

// For SET result - returns DenoKvSetResultExpectation
const setResult = {
  kind: "deno-kv:set",
  ok: true,
  versionstamp: "00000000000000010000",
  duration: 0,
} as unknown as DenoKvSetResult;
expectDenoKvResult(setResult).toBeOk().toHaveVersionstamp("00000000000000010000");

// For LIST result - returns DenoKvListResultExpectation<T>
const listResult = {
  kind: "deno-kv:list",
  ok: true,
  entries: [{ key: ["users", "1"], value: { name: "Alice" }, versionstamp: "00000000000000010000" }],
  duration: 0,
} as unknown as DenoKvListResult<{ name: string }>;
expectDenoKvResult(listResult).toBeOk().toHaveEntryCount(1);

// For DELETE result - returns DenoKvDeleteResultExpectation
const deleteResult = {
  kind: "deno-kv:delete",
  ok: true,
  duration: 0,
} as unknown as DenoKvDeleteResult;
expectDenoKvResult(deleteResult).toBeOk();

// For ATOMIC result - returns DenoKvAtomicResultExpectation
const atomicResult = {
  kind: "deno-kv:atomic",
  ok: true,
  versionstamp: "00000000000000010000",
  duration: 0,
} as unknown as DenoKvAtomicResult;
expectDenoKvResult(atomicResult).toBeOk().toHaveVersionstamp("00000000000000010000");
function

#expectGraphqlResponse

function expectGraphqlResponse(
  response: GraphqlResponse,
): GraphqlResponseExpectation
Parameters
function

#expectGrpcResponse

function expectGrpcResponse(response: GrpcResponse): GrpcResponseExpectation
Parameters
function

#expectHttpResponse

function expectHttpResponse(response: HttpResponse): HttpResponseExpectation
Parameters
function

#expectMongoResult

function expectMongoResult<R extends MongoResult>(
  result: R,
): MongoExpectation<R>

Create a fluent expectation chain for any MongoDB result validation.

This unified function accepts any MongoDB result type and returns the appropriate expectation interface based on the result's type discriminator.

Parameters
  • resultR
Examples
import type { MongoFindResult, MongoInsertOneResult, MongoUpdateResult, MongoDeleteResult, MongoFindOneResult, MongoCountResult } from "@probitas/client-mongodb";
import { expectMongoResult } from "./mongodb.ts";

// For find result - returns MongoFindResultExpectation
const findResult = {
  kind: "mongo:find",
  ok: true,
  docs: [{ name: "Alice" }],
  duration: 0,
} as unknown as MongoFindResult;
expectMongoResult(findResult).toBeOk().toHaveDocsCount(1);

// For insert result - returns MongoInsertOneResultExpectation
const insertResult = {
  kind: "mongo:insert-one",
  ok: true,
  insertedId: "123",
  duration: 0,
} as unknown as MongoInsertOneResult;
expectMongoResult(insertResult).toBeOk().toHaveInsertedId("123");

// For update result - returns MongoUpdateResultExpectation
const updateResult = {
  kind: "mongo:update",
  ok: true,
  matchedCount: 1,
  modifiedCount: 1,
  duration: 0,
} as unknown as MongoUpdateResult;
expectMongoResult(updateResult).toBeOk().toHaveMatchedCount(1).toHaveModifiedCount(1);

// For delete result - returns MongoDeleteResultExpectation
const deleteResult = {
  kind: "mongo:delete",
  ok: true,
  deletedCount: 1,
  duration: 0,
} as unknown as MongoDeleteResult;
expectMongoResult(deleteResult).toBeOk().toHaveDeletedCount(1);

// For findOne result - returns MongoFindOneResultExpectation
const findOneResult = {
  kind: "mongo:find-one",
  ok: true,
  doc: { name: "Alice" },
  duration: 0,
} as unknown as MongoFindOneResult;
expectMongoResult(findOneResult).toBeOk().toHaveDocPresent();

// For count result - returns MongoCountResultExpectation
const countResult = {
  kind: "mongo:count",
  ok: true,
  count: 10,
  duration: 0,
} as unknown as MongoCountResult;
expectMongoResult(countResult).toBeOk().toHaveCount(10);
function

#expectRabbitMqResult

function expectRabbitMqResult<R extends RabbitMqResult>(
  result: R,
): RabbitMqExpectation<R>

Create a fluent expectation chain for any RabbitMQ result validation.

This unified function accepts any RabbitMQ result type and returns the appropriate expectation interface based on the result's type discriminator.

Parameters
  • resultR
Examples
import type { RabbitMqPublishResult, RabbitMqConsumeResult, RabbitMqQueueResult, RabbitMqExchangeResult, RabbitMqAckResult } from "@probitas/client-rabbitmq";
import { expectRabbitMqResult } from "./rabbitmq.ts";

// For publish result - returns RabbitMqPublishResultExpectation
const publishResult = {
  kind: "rabbitmq:publish",
  ok: true,
  duration: 0,
} as unknown as RabbitMqPublishResult;
expectRabbitMqResult(publishResult).toBeOk();

// For consume result - returns RabbitMqConsumeResultExpectation
const consumeResult = {
  kind: "rabbitmq:consume",
  ok: true,
  message: { content: new Uint8Array() },
  duration: 0,
} as unknown as RabbitMqConsumeResult;
expectRabbitMqResult(consumeResult).toBeOk().toHaveMessagePresent();

// For queue result - returns RabbitMqQueueResultExpectation
const queueResult = {
  kind: "rabbitmq:queue",
  ok: true,
  queue: "my-queue",
  messageCount: 0,
  consumerCount: 0,
  duration: 0,
} as unknown as RabbitMqQueueResult;
expectRabbitMqResult(queueResult).toBeOk().toHaveMessageCount(0);

// For exchange result - returns RabbitMqExchangeResultExpectation
const exchangeResult = {
  kind: "rabbitmq:exchange",
  ok: true,
  duration: 0,
} as unknown as RabbitMqExchangeResult;
expectRabbitMqResult(exchangeResult).toBeOk();

// For ack result - returns RabbitMqAckResultExpectation
const ackResult = {
  kind: "rabbitmq:ack",
  ok: true,
  duration: 0,
} as unknown as RabbitMqAckResult;
expectRabbitMqResult(ackResult).toBeOk();
function

#expectRedisResult

function expectRedisResult<R extends RedisResult>(
  result: R,
): RedisExpectation<R>

Create a fluent expectation chain for any Redis result validation.

This unified function accepts any Redis result type and returns the appropriate expectation interface based on the result's type discriminator.

Parameters
  • resultR
Examples
import type { RedisGetResult, RedisCountResult, RedisArrayResult } from "@probitas/client-redis";
import { expectRedisResult } from "./redis.ts";

// For GET result - returns RedisGetResultExpectation
const getResult = {
  kind: "redis:get",
  ok: true,
  value: "expected",
  duration: 0,
} as unknown as RedisGetResult;
expectRedisResult(getResult).toBeOk().toHaveValue("expected");

// For COUNT result - returns RedisCountResultExpectation
const countResult = {
  kind: "redis:count",
  ok: true,
  value: 1,
  duration: 0,
} as unknown as RedisCountResult;
expectRedisResult(countResult).toBeOk().toHaveValue(1);

// For ARRAY result - returns RedisArrayResultExpectation
const arrayResult = {
  kind: "redis:array",
  ok: true,
  value: ["a", "b", "item"],
  duration: 0,
} as unknown as RedisArrayResult<string>;
expectRedisResult(arrayResult).toBeOk().toHaveValueCount(3).toHaveValueContaining("item");
function

#expectSqlQueryResult

function expectSqlQueryResult<T = Record<string, any>>(
  result: SqlQueryResult<T>,
): SqlQueryResultExpectation
Parameters
function

#expectSqsResult

function expectSqsResult<R extends SqsResult>(result: R): SqsExpectation<R>

Create a fluent expectation chain for any SQS result validation.

This unified function accepts any SQS result type and returns the appropriate expectation interface based on the result's type discriminator. Supports send, sendBatch, receive, delete, deleteBatch, ensureQueue, and deleteQueue results.

Parameters
  • resultR
    • The SQS result to create expectations for
Returns

SqsExpectation<R> — A typed expectation object matching the result type

Examples

Send result validation

import type { SqsSendResult } from "@probitas/client-sqs";
import { expectSqsResult } from "./sqs.ts";
const sendResult = {
  kind: "sqs:send",
  ok: true,
  messageId: "msg-123",
  md5OfBody: "abc123",
  sequenceNumber: undefined,
  duration: 50,
} as unknown as SqsSendResult;
expectSqsResult(sendResult)
  .toBeOk()
  .toHaveMessageIdContaining("msg")
  .toHaveDurationLessThan(1000);

Receive result validation

import type { SqsReceiveResult } from "@probitas/client-sqs";
import { expectSqsResult } from "./sqs.ts";
const receiveResult = {
  kind: "sqs:receive",
  ok: true,
  messages: [{ body: "test message" }],
  duration: 0,
} as unknown as SqsReceiveResult;
expectSqsResult(receiveResult)
  .toBeOk()
  .toHaveMessagesCountGreaterThanOrEqual(1);

Batch operations

import type { SqsSendBatchResult } from "@probitas/client-sqs";
import { expectSqsResult } from "./sqs.ts";
const batchResult = {
  kind: "sqs:send-batch",
  ok: true,
  successful: [{ id: "1" }, { id: "2" }],
  failed: [],
  duration: 0,
} as unknown as SqsSendBatchResult;
expectSqsResult(batchResult)
  .toBeOk()
  .toHaveSuccessfulCount(2)
  .toHaveFailedEmpty();

Queue management

import type { SqsEnsureQueueResult } from "@probitas/client-sqs";
import { expectSqsResult } from "./sqs.ts";
const ensureResult = {
  kind: "sqs:ensure-queue",
  ok: true,
  queueUrl: "https://sqs.example.com/test-queue",
  duration: 0,
} as unknown as SqsEnsureQueueResult;
expectSqsResult(ensureResult)
  .toBeOk()
  .toHaveQueueUrlContaining("test-queue");
function

#fromConnectError

function fromConnectError(
  error: ConnectError,
  metadata?: Headers,
): ConnectRpcError

Convert ConnectRPC's ConnectError to ConnectRpcError.

Parameters
  • errorConnectError
    • The ConnectError from @connectrpc/connect
  • metadata?Headers
    • Optional metadata from the response
Returns

ConnectRpcError — ConnectRpcError with statusCode for discrimination

function

#getStatusName

function getStatusName(code: ConnectRpcStatusCode): string

Get the name of a ConnectRPC/gRPC status code.

Parameters
Examples
getStatusName(0);  // "OK"
getStatusName(5);  // "NOT_FOUND"
getStatusName(16); // "UNAUTHENTICATED"
function

#isConnectRpcStatusCode

function isConnectRpcStatusCode(code: number): code is ConnectRpcStatusCode

Check if a number is a valid ConnectRPC/gRPC status code.

Parameters
  • codenumber
Examples
isConnectRpcStatusCode(0);   // true
isConnectRpcStatusCode(16);  // true
isConnectRpcStatusCode(99);  // false
function

#isExpectationError

function isExpectationError(err: unknown): boolean

Check if an error is an ExpectationError.

Handles both same-process (instanceof) and cross-process (name check) scenarios, supporting worker serialization.

Parameters
  • errunknown

Types

type

#BodyInit

type BodyInit = string | Uint8Array | FormData | URLSearchParams | unknown

Request body type.

type

#ConnectProtocol

type ConnectProtocol = "connect" | "grpc" | "grpc-web"

Protocol to use for ConnectRPC transport.

type

#ConnectRpcErrorType

type ConnectRpcErrorType = ConnectRpcError | ConnectRpcNetworkError

ConnectRPC error type union.

Contains either:

  • ConnectRpcError: gRPC error returned by the server
  • ConnectRpcNetworkError: Network-level failure before reaching the server
type

#ConnectRpcFailureError

type ConnectRpcFailureError = ConnectRpcNetworkError | AbortError | TimeoutError

Error types that indicate the operation was not processed. These are errors that occur before the request reaches the server.

type

#ConnectRpcResponse

type ConnectRpcResponse<T = any> = ConnectRpcResponseSuccess<T>
  | ConnectRpcResponseError<T>
  | ConnectRpcResponseFailure<T>

ConnectRPC response union type.

Use processed to distinguish between server responses and failures:

  • processed === true: Server responded (Success or Error)
  • processed === false: Request failed (Failure)

Use ok to check for success:

  • ok === true: Success (statusCode === 0)
  • ok === false: Error or Failure
type

#ConnectRpcStatusCode

type ConnectRpcStatusCode = unknown

ConnectRPC/gRPC status code type. Derived from ConnectRpcStatus values.

type

#DenoKvAtomicResult

type DenoKvAtomicResult = DenoKvAtomicResultCommitted
  | DenoKvAtomicResultCheckFailed
  | DenoKvAtomicResultError
  | DenoKvAtomicResultFailure

Result of an atomic operation.

Use ok and error to distinguish between outcomes:

  • ok === true: Committed successfully
  • ok === false && error === null: Check failed (retry with new versionstamp)
  • ok === false && error !== null: KV error or connection failure
type

#DenoKvDeleteResult

type DenoKvDeleteResult = DenoKvDeleteResultSuccess | DenoKvDeleteResultError | DenoKvDeleteResultFailure

Result of a delete operation.

type

#DenoKvExpectation

type DenoKvExpectation<R extends DenoKvResult> = R extends DenoKvGetResult<infer T>
    ? DenoKvGetResultExpectation<T>
    : R extends DenoKvListResult<infer T>
      ? DenoKvListResultExpectation<T>
      : R extends DenoKvSetResult
        ? DenoKvSetResultExpectation
        : R extends DenoKvDeleteResult
          ? DenoKvDeleteResultExpectation
          : R extends DenoKvAtomicResult ? DenoKvAtomicResultExpectation : never

Expectation type returned by expectDenoKvResult based on the result type.

type

#DenoKvFailureError

type DenoKvFailureError = DenoKvConnectionError | AbortError | TimeoutError

Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the Deno KV server.

type

#DenoKvGetResult

type DenoKvGetResult<T = any> = DenoKvGetResultSuccess<T> | DenoKvGetResultError<T> | DenoKvGetResultFailure<T>

Result of a get operation.

Use ok to check for success, then narrow the type:

  • ok === true: Success - value may be present
  • ok === false && processed === true: KV error (quota, etc.)
  • ok === false && processed === false: Connection failure
type

#DenoKvListResult

type DenoKvListResult<T = any> = DenoKvListResultSuccess<T>
  | DenoKvListResultError<T>
  | DenoKvListResultFailure<T>

Result of a list operation.

type

#DenoKvResult

type DenoKvResult<T = any> = DenoKvGetResult<T>
  | DenoKvSetResult
  | DenoKvDeleteResult
  | DenoKvListResult<T>
  | DenoKvAtomicResult

Union of all Deno KV result types.

type

#DenoKvSetResult

type DenoKvSetResult = DenoKvSetResultSuccess | DenoKvSetResultError | DenoKvSetResultFailure

Result of a set operation.

type

#Document

type Document<T = any> = Record<string, T>

MongoDB document type

type

#FileDescriptorSet

type FileDescriptorSet = MessageShape<FileDescriptorSetSchema>

FileDescriptorSet message type from @bufbuild/protobuf. This is the decoded protobuf message containing file descriptors.

type

#Filter

type Filter = Record<string, any>

MongoDB filter type (simplified for compatibility with mongodb driver) Allows query operators like $gte, $lt, $in, etc.

type

#GraphqlFailureError

type GraphqlFailureError = GraphqlNetworkError | AbortError | TimeoutError

Error types that indicate the operation was not processed. These are errors that occur before the request reaches the GraphQL server.

type

#GraphqlResponse

type GraphqlResponse<T = any> = GraphqlResponseSuccess<T> | GraphqlResponseError<T> | GraphqlResponseFailure<T>

GraphQL response union type.

Use processed to distinguish between server responses and failures:

  • processed === true: Server responded (Success or Error)
  • processed === false: Request failed (Failure)

Use ok to check for success:

  • ok === true: Success (no errors)
  • ok === false: Error or Failure
type

#HttpFailureError

type HttpFailureError = HttpNetworkError | AbortError | TimeoutError

Error types that indicate the operation was not processed. These are errors that occur before the request reaches the server.

type

#HttpResponse

type HttpResponse<T = any> = HttpResponseSuccess<T> | HttpResponseError<T> | HttpResponseFailure<T>

HTTP response union type representing all possible response states.

  • Success (2xx): processed: true, ok: true, error: null
  • Error (4xx/5xx): processed: true, ok: false, error: HttpError
  • Failure (network error): processed: false, ok: false, error: Error
type

#HttpVersion

type HttpVersion = "1.1" | "2"

HTTP version for transport.

type

#MongoCountResult

type MongoCountResult = MongoCountResultSuccess | MongoCountResultError | MongoCountResultFailure

Count result.

type

#MongoDeleteResult

type MongoDeleteResult = MongoDeleteResultSuccess | MongoDeleteResultError | MongoDeleteResultFailure

Delete result.

type

#MongoExpectation

type MongoExpectation<R extends MongoResult> = R extends MongoFindResult<infer T>
    ? MongoFindResultExpectation<T>
    : R extends MongoInsertOneResult
      ? MongoInsertOneResultExpectation
      : R extends MongoInsertManyResult
        ? MongoInsertManyResultExpectation
        : R extends MongoUpdateResult
          ? MongoUpdateResultExpectation
          : R extends MongoDeleteResult
            ? MongoDeleteResultExpectation
            : R extends MongoFindOneResult<infer T>
              ? MongoFindOneResultExpectation<T>
              : R extends MongoCountResult ? MongoCountResultExpectation : never

Expectation type returned by expectMongoResult based on the result type.

type

#MongoFailureError

type MongoFailureError = MongoConnectionError | AbortError | TimeoutError

Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the MongoDB server.

type

#MongoFindOneResult

type MongoFindOneResult<T = Document> = MongoFindOneResultSuccess<T>
  | MongoFindOneResultError<T>
  | MongoFindOneResultFailure<T>

FindOne result.

type

#MongoFindResult

type MongoFindResult<T = Document> = MongoFindResultSuccess<T> | MongoFindResultError<T> | MongoFindResultFailure<T>

Query result (find, aggregate).

type

#MongoInsertManyResult

type MongoInsertManyResult = MongoInsertManyResultSuccess
  | MongoInsertManyResultError
  | MongoInsertManyResultFailure

Insert many result.

type

#MongoInsertOneResult

type MongoInsertOneResult = MongoInsertOneResultSuccess
  | MongoInsertOneResultError
  | MongoInsertOneResultFailure

Insert one result.

type

#MongoOperationError

type MongoOperationError = MongoQueryError
  | MongoDuplicateKeyError
  | MongoValidationError
  | MongoWriteError
  | MongoNotFoundError
  | MongoError

Error types that indicate a MongoDB operation error. These are errors where the operation reached the server but failed.

type

#MongoResult

type MongoResult<T = any> = MongoFindResult<T>
  | MongoInsertOneResult
  | MongoInsertManyResult
  | MongoUpdateResult
  | MongoDeleteResult
  | MongoFindOneResult<T>
  | MongoCountResult

Union of all MongoDB result types.

type

#MongoUpdateResult

type MongoUpdateResult = MongoUpdateResultSuccess | MongoUpdateResultError | MongoUpdateResultFailure

Update result.

type

#QueryParams

type QueryParams = URLSearchParams | Record<string, QueryValue | QueryValue[]>

Query parameters type - accepts URLSearchParams or plain object.

type

#QueryValue

type QueryValue = string | number | boolean

Query parameter value type.

type

#RabbitMqAckResult

type RabbitMqAckResult = RabbitMqAckResultSuccess | RabbitMqAckResultError | RabbitMqAckResultFailure

Ack/Nack result.

type

#RabbitMqConsumeResult

type RabbitMqConsumeResult = RabbitMqConsumeResultSuccess
  | RabbitMqConsumeResultError
  | RabbitMqConsumeResultFailure

Consume result (single message retrieval).

type

#RabbitMqExchangeResult

type RabbitMqExchangeResult = RabbitMqExchangeResultSuccess
  | RabbitMqExchangeResultError
  | RabbitMqExchangeResultFailure

Exchange declaration result.

type

#RabbitMqExchangeType

type RabbitMqExchangeType = "direct" | "topic" | "fanout" | "headers"

Exchange type.

type

#RabbitMqExpectation

type RabbitMqExpectation<R extends RabbitMqResult> = R extends RabbitMqConsumeResult
    ? RabbitMqConsumeResultExpectation
    : R extends RabbitMqQueueResult
      ? RabbitMqQueueResultExpectation
      : R extends RabbitMqPublishResult
        ? RabbitMqPublishResultExpectation
        : R extends RabbitMqExchangeResult
          ? RabbitMqExchangeResultExpectation
          : R extends RabbitMqAckResult ? RabbitMqAckResultExpectation : never

Expectation type returned by expectRabbitMqResult based on the result type.

type

#RabbitMqFailureError

type RabbitMqFailureError = RabbitMqConnectionError | AbortError | TimeoutError

Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the RabbitMQ server.

type

#RabbitMqOperationError

type RabbitMqOperationError = RabbitMqChannelError
  | RabbitMqNotFoundError
  | RabbitMqPreconditionFailedError
  | RabbitMqError

Error types that indicate a RabbitMQ operation error. These are errors where the operation reached the server but failed.

type

#RabbitMqPublishResult

type RabbitMqPublishResult = RabbitMqPublishResultSuccess
  | RabbitMqPublishResultError
  | RabbitMqPublishResultFailure

Publish result.

type

#RabbitMqQueueResult

type RabbitMqQueueResult = RabbitMqQueueResultSuccess
  | RabbitMqQueueResultError
  | RabbitMqQueueResultFailure

Queue declaration result.

type

#RabbitMqResult

type RabbitMqResult = RabbitMqPublishResult
  | RabbitMqConsumeResult
  | RabbitMqAckResult
  | RabbitMqQueueResult
  | RabbitMqExchangeResult

Union of all RabbitMQ result types.

type

#RedirectMode

type RedirectMode = "follow" | "manual" | "error"

Redirect handling mode.

  • "follow": Automatically follow redirects (default)
  • "manual": Return redirect response without following
  • "error": Throw error on redirect
type

#RedisArrayResult

type RedisArrayResult<T = string> = RedisArrayResultSuccess<T>
  | RedisArrayResultError<T>
  | RedisArrayResultFailure<T>

Redis array result (LRANGE, SMEMBERS, etc.).

type

#RedisCommonResult

type RedisCommonResult<T = any> = RedisCommonResultSuccess<T>
  | RedisCommonResultError<T>
  | RedisCommonResultFailure<T>

Redis operation result (common/generic).

Used for operations without a more specific result type.

type

#RedisCountResult

type RedisCountResult = RedisCountResultSuccess | RedisCountResultError | RedisCountResultFailure

Redis numeric result (DEL, LPUSH, SADD, etc.).

type

#RedisExpectation

type RedisExpectation<R extends RedisResult> = R extends RedisCountResult
    ? RedisCountResultExpectation
    : R extends RedisArrayResult
      ? RedisArrayResultExpectation
      : R extends RedisGetResult
        ? RedisGetResultExpectation
        : R extends RedisSetResult
          ? RedisSetResultExpectation
          : R extends RedisHashResult
            ? RedisHashResultExpectation
            : R extends RedisCommonResult ? RedisCommonResultExpectation : never

Expectation type returned by expectRedisResult based on the result type.

type

#RedisFailureError

type RedisFailureError = RedisConnectionError | AbortError | TimeoutError

Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the Redis server.

type

#RedisGetResult

type RedisGetResult = RedisGetResultSuccess | RedisGetResultError | RedisGetResultFailure

Redis GET result.

type

#RedisHashResult

type RedisHashResult = RedisHashResultSuccess | RedisHashResultError | RedisHashResultFailure

Redis hash result (HGETALL).

type

#RedisOperationError

type RedisOperationError = RedisCommandError | RedisScriptError | RedisError

Error types that indicate the operation was processed but failed. These are errors returned by the Redis server.

type

#RedisResult

type RedisResult<T = any> = RedisCommonResult<T>
  | RedisGetResult
  | RedisSetResult
  | RedisCountResult
  | RedisArrayResult<T>
  | RedisHashResult

Union of all Redis result types.

type

#RedisSetResult

type RedisSetResult = RedisSetResultSuccess | RedisSetResultError | RedisSetResultFailure

Redis SET result.

type

#SqlErrorKind

type SqlErrorKind = "query" | "constraint" | "deadlock" | "connection" | "unknown"

SQL-specific error kinds.

type

#SqlFailureError

type SqlFailureError = SqlConnectionError | AbortError | TimeoutError

Error types that indicate the operation was not processed. These are errors that occur before the query reaches the SQL server.

type

#SqlIsolationLevel

type SqlIsolationLevel = "read_uncommitted" | "read_committed" | "repeatable_read" | "serializable"

Transaction isolation level.

type

#SqlOperationError

type SqlOperationError = QuerySyntaxError | ConstraintError | DeadlockError | SqlError

Error types that indicate an operation was processed by the server. These errors occur after the query reaches the SQL server.

type

#SqlQueryResult

type SqlQueryResult<T = any> = SqlQueryResultSuccess<T> | SqlQueryResultError<T> | SqlQueryResultFailure<T>

SQL query result union type representing all possible result states.

  • Success: processed: true, ok: true, error: null
  • Error: processed: true, ok: false, error: SqlError
  • Failure: processed: false, ok: false, error: SqlConnectionError
type

#SqsDeleteBatchResult

type SqsDeleteBatchResult = SqsDeleteBatchResultSuccess
  | SqsDeleteBatchResultError
  | SqsDeleteBatchResultFailure

Result of batch deleting messages.

type

#SqsDeleteQueueResult

type SqsDeleteQueueResult = SqsDeleteQueueResultSuccess
  | SqsDeleteQueueResultError
  | SqsDeleteQueueResultFailure

Result of deleting a queue.

type

#SqsDeleteResult

type SqsDeleteResult = SqsDeleteResultSuccess | SqsDeleteResultError | SqsDeleteResultFailure

Result of deleting a message.

type

#SqsEnsureQueueResult

type SqsEnsureQueueResult = SqsEnsureQueueResultSuccess
  | SqsEnsureQueueResultError
  | SqsEnsureQueueResultFailure

Result of ensuring a queue exists.

type

#SqsExpectation

type SqsExpectation<R extends SqsResult> = R extends SqsSendResult
    ? SqsSendResultExpectation
    : R extends SqsSendBatchResult
      ? SqsSendBatchResultExpectation
      : R extends SqsReceiveResult
        ? SqsReceiveResultExpectation
        : R extends SqsDeleteResult
          ? SqsDeleteResultExpectation
          : R extends SqsDeleteBatchResult
            ? SqsSendBatchResultExpectation
            : R extends SqsEnsureQueueResult
              ? SqsEnsureQueueResultExpectation
              : R extends SqsDeleteQueueResult ? SqsDeleteQueueResultExpectation : never

Expectation type returned by expectSqsResult based on the result type.

type

#SqsFailureError

type SqsFailureError = SqsConnectionError | AbortError | TimeoutError

Error types that indicate the operation was not processed. These are errors that occur before the operation reaches the SQS service.

type

#SqsOperationError

type SqsOperationError = SqsCommandError
  | SqsQueueNotFoundError
  | SqsMessageTooLargeError
  | SqsBatchError
  | SqsMessageNotFoundError
  | SqsError

Error types that indicate an operation was processed by the server. These errors occur after the operation reaches the SQS service.

type

#SqsReceiveResult

type SqsReceiveResult = SqsReceiveResultSuccess | SqsReceiveResultError | SqsReceiveResultFailure

Result of receiving messages.

type

#SqsResult

type SqsResult = SqsSendResult
  | SqsSendBatchResult
  | SqsReceiveResult
  | SqsDeleteResult
  | SqsDeleteBatchResult
  | SqsEnsureQueueResult
  | SqsDeleteQueueResult

Union type of all SQS result types.

type

#SqsSendBatchResult

type SqsSendBatchResult = SqsSendBatchResultSuccess | SqsSendBatchResultError | SqsSendBatchResultFailure

Result of batch sending messages.

type

#SqsSendResult

type SqsSendResult = SqsSendResultSuccess | SqsSendResultError | SqsSendResultFailure

Result of sending a message.

type

#UpdateFilter

type UpdateFilter = Record<string, any>

MongoDB update filter type (simplified for compatibility with mongodb driver) Allows update operators like $set, $inc, $unset, etc.

Variables

const

#ConnectRpcStatus

const ConnectRpcStatus: {
  OK: number;
  CANCELLED: number;
  UNKNOWN: number;
  INVALID_ARGUMENT: number;
  DEADLINE_EXCEEDED: number;
  NOT_FOUND: number;
  ALREADY_EXISTS: number;
  PERMISSION_DENIED: number;
  RESOURCE_EXHAUSTED: number;
  FAILED_PRECONDITION: number;
  ABORTED: number;
  OUT_OF_RANGE: number;
  UNIMPLEMENTED: number;
  INTERNAL: number;
  UNAVAILABLE: number;
  DATA_LOSS: number;
  UNAUTHENTICATED: number;
}

ConnectRPC/gRPC status codes. These codes are used by both gRPC and ConnectRPC protocols.

const

#outdent

const outdent: Outdent
Search Documentation