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

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

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

Executes a function, expecting it to throw. 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: () => T
optional
ErrorClass: Constructor
optional
msgIncludes = [UNSUPPORTED]
optional
msg: string

Returns

Error