()
| 682 | it('should calculate durations correctly for suspended views', async () => { |
| 683 | let data; |
| 684 | const getData = () => { |
| 685 | if (React.use) { |
| 686 | if (!data) { |
| 687 | data = new Promise(resolve => { |
| 688 | resolve('abc'); |
| 689 | }); |
| 690 | } |
| 691 | return React.use(data); |
| 692 | } |
| 693 | if (data) { |
| 694 | return data; |
| 695 | } else { |
| 696 | throw new Promise(resolve => { |
| 697 | data = 'abc'; |
| 698 | resolve(data); |
| 699 | }); |
| 700 | } |
| 701 | }; |
| 702 | |
| 703 | const Parent = () => { |
| 704 | Scheduler.unstable_advanceTime(10); |