(promise: Promise<unknown>)
| 8 | @returns The rejection reason, typed as `ExecaError` by default. |
| 9 | */ |
| 10 | export const rejectionOf = async <ErrorType = ExecaError>(promise: Promise<unknown>): Promise<ErrorType> => { |
| 11 | try { |
| 12 | await promise; |
| 13 | } catch (error) { |
| 14 | return error as ErrorType; |
| 15 | } |
| 16 | |
| 17 | throw new Error('Expected the promise to reject, but it resolved.'); |
| 18 | }; |
no outgoing calls
no test coverage detected
searching dependent graphs…