function assertRpcErr
assertRpcErr<T, E extends BaseError>(
resultLike: MaybeAsync<T, E>,
expectedErrorNameOrCtor?: string | TrellisTestErrorConstructor<E>
): Promise<E>

Asserts that a Trellis RPC-style result is Err and returns the error.

The optional expectation may be an error name string or an error class.

Type Parameters

E extends BaseError

Parameters

resultLike: MaybeAsync<T, E>
optional
expectedErrorNameOrCtor: string | TrellisTestErrorConstructor<E>

Return Type

Promise<E>

Usage

import { assertRpcErr } from "trellis-test/index.ts";