Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
denoland/stdWorks with
•JSR Score100%•This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




License
•MIT
Downloads7,543/wk
•Published2 months ago (1.0.19)
Common assertion functions, especially useful for testing
- @std/assert
is-error
- all symbols
- default
- almost-equals
- array-includes
- assert
- assertion-error
- equal
- equals
- exists
- fail
- false
- greater
- greater-or-equal
- instance-of
- is-error
- less
- less-or-equal
- match
- not-equals
- not-instance-of
- not-match
- not-strict-equals
- object-match
- rejects
- strict-equals
- string-includes
- throws
- unimplemented
- unreachable
- unstable-equals
- unstable-never
- unstable-strict-equals
Functions
f
assertIsError<E extends Error = Error>(): asserts error is E
error: unknown,
ErrorClass?: new (...args: any[]) => E,
msgMatches?: string | RegExp,
msg?: string
Make an assertion that error is an Error.
If not then an error will be thrown.
An error class and a string that should be included in the
error message can also be asserted.