Works with
•JSR Score70%•It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun




Published2 years ago (0.215.0)
- @std/assert
assert_throws
- all symbols
- default
- assert
- assert_almost_equals
- assert_array_includes
- assert_equals
- assert_exists
- assert_false
- assert_greater
- assert_greater_or_equal
- assert_instance_of
- assert_is_error
- assert_less
- assert_less_or_equal
- assert_match
- assert_not_equals
- assert_not_instance_of
- assert_not_match
- assert_not_strict_equals
- assert_object_match
- assert_rejects
- assert_strict_equals
- assert_string_includes
- assert_throws
- assertion_error
- equal
- fail
- unimplemented
- unreachable
Functions
f
assertThrows<E extends Error = Error>(): E | Error | unknown
fn: () => unknown,
errorClassOrMsg?: (new (...args: any[]) => E) | string,
msgIncludesOrMsg?: string,
msg?: string
2 overloads
Executes a function, expecting it to throw. If it does not, then it throws.