Expect to throw with Typescript using Bun:test - ts(2348)
typescript, bunjs

Basic Example
Be careful on
() =>
Async Example
Use
rejectsforPromise
Advanced Usage with Custom Error Types
Use
new CustomError()insteadCustomErrorto prevent warningBe careful on
() =>
Value of type "typeof X' is not callable. Did you mean to include 'new'? ts(2348)
To prevent the error shown (it can run as expected) use
new AlreadyAdjusted()


Last updated
Was this helpful?