( fn: () => unknown, )
| 48 | } |
| 49 | |
| 50 | export function expectToThrowJSON( |
| 51 | fn: () => unknown, |
| 52 | ): ReturnType<typeof expect> { |
| 53 | function mapException(): unknown { |
| 54 | try { |
| 55 | return fn(); |
| 56 | } catch (error) { |
| 57 | throw toJSONDeep(error); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | return expect(mapException).to.throw(); |
| 62 | } |
no outgoing calls