(shouldThrow?: boolean, resolve?: boolean)
| 573 | |
| 574 | describe('promise/async throws if Error-like object is returned', () => { |
| 575 | const asyncFn = async (shouldThrow?: boolean, resolve?: boolean) => { |
| 576 | let err; |
| 577 | if (shouldThrow) { |
| 578 | err = new Err('async apple'); |
| 579 | } |
| 580 | if (resolve) { |
| 581 | return err || 'apple'; |
| 582 | } else { |
| 583 | throw err || 'apple'; |
| 584 | } |
| 585 | }; |
| 586 | |
| 587 | test('passes', async () => { |
| 588 | expect.assertions(24); |
no outgoing calls
no test coverage detected