Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/html_parser/src/deps.ts>assertions.assertThrowsAsync

Port of fb55/htmlparser2 for Deno
Very Popular
Latest
function assertions.assertThrowsAsync
import { assertions } from "https://deno.land/x/html_parser@v0.1.3/src/deps.ts";
const { assertThrowsAsync } = assertions;

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>