Skip to main content
Module

x/momentum/di/test_deps.ts>assertThrowsAsync

Momentum is an open-source framework for building server-side Deno applications in TypeScript. It provides the paradigms and design patterns to guide developers to create robust, scalable, and enterprise-grade applications.
Latest
function assertThrowsAsync
import { assertThrowsAsync } from "https://deno.land/x/momentum@v0.8.2/di/test_deps.ts";

Executes a function which returns a promise, expecting it to throw or reject. If it does not, then it throws. An error class and a string that should be included in the error message can also be asserted.

Type Parameters

optional
T = void

Parameters

fn: () => Promise<T>
optional
ErrorClass: Constructor
optional
msgIncludes = [UNSUPPORTED]
optional
msg: string

Returns

Promise<Error>