(errors: Array<mixed>)
| 121 | } |
| 122 | |
| 123 | function aggregateErrors(errors: Array<mixed>): mixed { |
| 124 | if (errors.length > 1 && typeof AggregateError === 'function') { |
| 125 | // eslint-disable-next-line no-undef |
| 126 | return new AggregateError(errors); |
| 127 | } |
| 128 | return errors[0]; |
| 129 | } |
| 130 | |
| 131 | export async function waitForThrow(expectedError: mixed): mixed { |
| 132 | assertYieldsWereCleared(waitForThrow); |