apiDefineAsyncComponent.spec.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. import { nextTick, ref } from '@vue/runtime-dom'
  2. import { type VaporComponent, createComponent } from '../src/component'
  3. import { defineVaporAsyncComponent } from '../src/apiDefineAsyncComponent'
  4. import { makeRender } from './_utils'
  5. import {
  6. createIf,
  7. createTemplateRefSetter,
  8. renderEffect,
  9. template,
  10. } from '@vue/runtime-vapor'
  11. import { setElementText } from '../src/dom/prop'
  12. const timeout = (n: number = 0) => new Promise(r => setTimeout(r, n))
  13. const define = makeRender()
  14. describe('api: defineAsyncComponent', () => {
  15. test('simple usage', async () => {
  16. let resolve: (comp: VaporComponent) => void
  17. const Foo = defineVaporAsyncComponent(
  18. () =>
  19. new Promise(r => {
  20. resolve = r as any
  21. }),
  22. )
  23. const toggle = ref(true)
  24. const { html } = define({
  25. setup() {
  26. return createIf(
  27. () => toggle.value,
  28. () => {
  29. return createComponent(Foo)
  30. },
  31. )
  32. },
  33. }).render()
  34. expect(html()).toBe('<!--async component--><!--if-->')
  35. resolve!(() => template('resolved')())
  36. await timeout()
  37. expect(html()).toBe('resolved<!--async component--><!--if-->')
  38. toggle.value = false
  39. await nextTick()
  40. expect(html()).toBe('<!--if-->')
  41. // already resolved component should update on nextTick
  42. toggle.value = true
  43. await nextTick()
  44. expect(html()).toBe('resolved<!--async component--><!--if-->')
  45. })
  46. test('with loading component', async () => {
  47. let resolve: (comp: VaporComponent) => void
  48. const Foo = defineVaporAsyncComponent({
  49. loader: () =>
  50. new Promise(r => {
  51. resolve = r as any
  52. }),
  53. loadingComponent: () => template('loading')(),
  54. delay: 1, // defaults to 200
  55. })
  56. const toggle = ref(true)
  57. const { html } = define({
  58. setup() {
  59. return createIf(
  60. () => toggle.value,
  61. () => {
  62. return createComponent(Foo)
  63. },
  64. )
  65. },
  66. }).render()
  67. // due to the delay, initial mount should be empty
  68. expect(html()).toBe('<!--async component--><!--if-->')
  69. // loading show up after delay
  70. await timeout(1)
  71. expect(html()).toBe('loading<!--async component--><!--if-->')
  72. resolve!(() => template('resolved')())
  73. await timeout()
  74. expect(html()).toBe('resolved<!--async component--><!--if-->')
  75. toggle.value = false
  76. await nextTick()
  77. expect(html()).toBe('<!--if-->')
  78. // already resolved component should update on nextTick without loading
  79. // state
  80. toggle.value = true
  81. await nextTick()
  82. expect(html()).toBe('resolved<!--async component--><!--if-->')
  83. })
  84. test('with loading component + explicit delay (0)', async () => {
  85. let resolve: (comp: VaporComponent) => void
  86. const Foo = defineVaporAsyncComponent({
  87. loader: () =>
  88. new Promise(r => {
  89. resolve = r as any
  90. }),
  91. loadingComponent: () => template('loading')(),
  92. delay: 0,
  93. })
  94. const toggle = ref(true)
  95. const { html } = define({
  96. setup() {
  97. return createIf(
  98. () => toggle.value,
  99. () => {
  100. return createComponent(Foo)
  101. },
  102. )
  103. },
  104. }).render()
  105. // with delay: 0, should show loading immediately
  106. expect(html()).toBe('loading<!--async component--><!--if-->')
  107. resolve!(() => template('resolved')())
  108. await timeout()
  109. expect(html()).toBe('resolved<!--async component--><!--if-->')
  110. toggle.value = false
  111. await nextTick()
  112. expect(html()).toBe('<!--if-->')
  113. // already resolved component should update on nextTick without loading
  114. // state
  115. toggle.value = true
  116. await nextTick()
  117. expect(html()).toBe('resolved<!--async component--><!--if-->')
  118. })
  119. test('error without error component', async () => {
  120. let resolve: (comp: VaporComponent) => void
  121. let reject: (e: Error) => void
  122. const Foo = defineVaporAsyncComponent(
  123. () =>
  124. new Promise((_resolve, _reject) => {
  125. resolve = _resolve as any
  126. reject = _reject
  127. }),
  128. )
  129. const toggle = ref(true)
  130. const { app, mount } = define({
  131. setup() {
  132. return createIf(
  133. () => toggle.value,
  134. () => {
  135. return createComponent(Foo)
  136. },
  137. )
  138. },
  139. }).create()
  140. const handler = (app.config.errorHandler = vi.fn())
  141. const root = document.createElement('div')
  142. mount(root)
  143. expect(root.innerHTML).toBe('<!--async component--><!--if-->')
  144. const err = new Error('foo')
  145. reject!(err)
  146. await timeout()
  147. expect(handler).toHaveBeenCalled()
  148. expect(handler.mock.calls[0][0]).toBe(err)
  149. expect(root.innerHTML).toBe('<!--async component--><!--if-->')
  150. toggle.value = false
  151. await nextTick()
  152. expect(root.innerHTML).toBe('<!--if-->')
  153. // errored out on previous load, toggle and mock success this time
  154. toggle.value = true
  155. await nextTick()
  156. expect(root.innerHTML).toBe('<!--async component--><!--if-->')
  157. // should render this time
  158. resolve!(() => template('resolved')())
  159. await timeout()
  160. expect(root.innerHTML).toBe('resolved<!--async component--><!--if-->')
  161. })
  162. test('error with error component', async () => {
  163. let resolve: (comp: VaporComponent) => void
  164. let reject: (e: Error) => void
  165. const Foo = defineVaporAsyncComponent({
  166. loader: () =>
  167. new Promise((_resolve, _reject) => {
  168. resolve = _resolve as any
  169. reject = _reject
  170. }),
  171. errorComponent: (props: { error: Error }) =>
  172. template(props.error.message)(),
  173. })
  174. const toggle = ref(true)
  175. const { app, mount } = define({
  176. setup() {
  177. return createIf(
  178. () => toggle.value,
  179. () => {
  180. return createComponent(Foo)
  181. },
  182. )
  183. },
  184. }).create()
  185. const handler = (app.config.errorHandler = vi.fn())
  186. const root = document.createElement('div')
  187. mount(root)
  188. expect(root.innerHTML).toBe('<!--async component--><!--if-->')
  189. const err = new Error('errored out')
  190. reject!(err)
  191. await timeout()
  192. expect(handler).toHaveBeenCalled()
  193. expect(root.innerHTML).toBe('errored out<!--async component--><!--if-->')
  194. toggle.value = false
  195. await nextTick()
  196. expect(root.innerHTML).toBe('<!--if-->')
  197. // errored out on previous load, toggle and mock success this time
  198. toggle.value = true
  199. await nextTick()
  200. expect(root.innerHTML).toBe('<!--async component--><!--if-->')
  201. // should render this time
  202. resolve!(() => template('resolved')())
  203. await timeout()
  204. expect(root.innerHTML).toBe('resolved<!--async component--><!--if-->')
  205. })
  206. test('error with error component, without global handler', async () => {
  207. let resolve: (comp: VaporComponent) => void
  208. let reject: (e: Error) => void
  209. const Foo = defineVaporAsyncComponent({
  210. loader: () =>
  211. new Promise((_resolve, _reject) => {
  212. resolve = _resolve as any
  213. reject = _reject
  214. }),
  215. errorComponent: (props: { error: Error }) =>
  216. template(props.error.message)(),
  217. })
  218. const toggle = ref(true)
  219. const { mount } = define({
  220. setup() {
  221. return createIf(
  222. () => toggle.value,
  223. () => {
  224. return createComponent(Foo)
  225. },
  226. )
  227. },
  228. }).create()
  229. const root = document.createElement('div')
  230. mount(root)
  231. expect(root.innerHTML).toBe('<!--async component--><!--if-->')
  232. const err = new Error('errored out')
  233. reject!(err)
  234. await timeout()
  235. expect(root.innerHTML).toBe('errored out<!--async component--><!--if-->')
  236. expect(
  237. 'Unhandled error during execution of async component loader',
  238. ).toHaveBeenWarned()
  239. toggle.value = false
  240. await nextTick()
  241. expect(root.innerHTML).toBe('<!--if-->')
  242. // errored out on previous load, toggle and mock success this time
  243. toggle.value = true
  244. await nextTick()
  245. expect(root.innerHTML).toBe('<!--async component--><!--if-->')
  246. // should render this time
  247. resolve!(() => template('resolved')())
  248. await timeout()
  249. expect(root.innerHTML).toBe('resolved<!--async component--><!--if-->')
  250. })
  251. test('error with error + loading components', async () => {
  252. let resolve: (comp: VaporComponent) => void
  253. let reject: (e: Error) => void
  254. const Foo = defineVaporAsyncComponent({
  255. loader: () =>
  256. new Promise((_resolve, _reject) => {
  257. resolve = _resolve as any
  258. reject = _reject
  259. }),
  260. errorComponent: (props: { error: Error }) =>
  261. template(props.error.message)(),
  262. loadingComponent: () => template('loading')(),
  263. delay: 1,
  264. })
  265. const toggle = ref(true)
  266. const { app, mount } = define({
  267. setup() {
  268. return createIf(
  269. () => toggle.value,
  270. () => {
  271. return createComponent(Foo)
  272. },
  273. )
  274. },
  275. }).create()
  276. const handler = (app.config.errorHandler = vi.fn())
  277. const root = document.createElement('div')
  278. mount(root)
  279. // due to the delay, initial mount should be empty
  280. expect(root.innerHTML).toBe('<!--async component--><!--if-->')
  281. // loading show up after delay
  282. await timeout(1)
  283. expect(root.innerHTML).toBe('loading<!--async component--><!--if-->')
  284. const err = new Error('errored out')
  285. reject!(err)
  286. await timeout()
  287. expect(handler).toHaveBeenCalled()
  288. expect(root.innerHTML).toBe('errored out<!--async component--><!--if-->')
  289. toggle.value = false
  290. await nextTick()
  291. expect(root.innerHTML).toBe('<!--if-->')
  292. // errored out on previous load, toggle and mock success this time
  293. toggle.value = true
  294. await nextTick()
  295. expect(root.innerHTML).toBe('<!--async component--><!--if-->')
  296. // loading show up after delay
  297. await timeout(1)
  298. expect(root.innerHTML).toBe('loading<!--async component--><!--if-->')
  299. // should render this time
  300. resolve!(() => template('resolved')())
  301. await timeout()
  302. expect(root.innerHTML).toBe('resolved<!--async component--><!--if-->')
  303. })
  304. test('timeout without error component', async () => {
  305. let resolve: (comp: VaporComponent) => void
  306. const Foo = defineVaporAsyncComponent({
  307. loader: () =>
  308. new Promise(_resolve => {
  309. resolve = _resolve as any
  310. }),
  311. timeout: 1,
  312. })
  313. const { app, mount } = define({
  314. setup() {
  315. return createComponent(Foo)
  316. },
  317. }).create()
  318. const handler = vi.fn()
  319. app.config.errorHandler = handler
  320. const root = document.createElement('div')
  321. mount(root)
  322. expect(root.innerHTML).toBe('<!--async component-->')
  323. await timeout(1)
  324. expect(handler).toHaveBeenCalled()
  325. expect(handler.mock.calls[0][0].message).toMatch(
  326. `Async component timed out after 1ms.`,
  327. )
  328. expect(root.innerHTML).toBe('<!--async component-->')
  329. // if it resolved after timeout, should still work
  330. resolve!(() => template('resolved')())
  331. await timeout()
  332. expect(root.innerHTML).toBe('resolved<!--async component-->')
  333. })
  334. test('timeout with error component', async () => {
  335. let resolve: (comp: VaporComponent) => void
  336. const Foo = defineVaporAsyncComponent({
  337. loader: () =>
  338. new Promise(_resolve => {
  339. resolve = _resolve as any
  340. }),
  341. timeout: 1,
  342. errorComponent: () => template('timed out')(),
  343. })
  344. const root = document.createElement('div')
  345. const { app, mount } = define({
  346. setup() {
  347. return createComponent(Foo)
  348. },
  349. }).create()
  350. const handler = (app.config.errorHandler = vi.fn())
  351. mount(root)
  352. expect(root.innerHTML).toBe('<!--async component-->')
  353. await timeout(1)
  354. expect(handler).toHaveBeenCalled()
  355. expect(root.innerHTML).toBe('timed out<!--async component-->')
  356. // if it resolved after timeout, should still work
  357. resolve!(() => template('resolved')())
  358. await timeout()
  359. expect(root.innerHTML).toBe('resolved<!--async component-->')
  360. })
  361. test('timeout with error + loading components', async () => {
  362. let resolve: (comp: VaporComponent) => void
  363. const Foo = defineVaporAsyncComponent({
  364. loader: () =>
  365. new Promise(_resolve => {
  366. resolve = _resolve as any
  367. }),
  368. delay: 1,
  369. timeout: 16,
  370. errorComponent: () => template('timed out')(),
  371. loadingComponent: () => template('loading')(),
  372. })
  373. const root = document.createElement('div')
  374. const { app, mount } = define({
  375. setup() {
  376. return createComponent(Foo)
  377. },
  378. }).create()
  379. const handler = (app.config.errorHandler = vi.fn())
  380. mount(root)
  381. expect(root.innerHTML).toBe('<!--async component-->')
  382. await timeout(1)
  383. expect(root.innerHTML).toBe('loading<!--async component-->')
  384. await timeout(16)
  385. expect(root.innerHTML).toBe('timed out<!--async component-->')
  386. expect(handler).toHaveBeenCalled()
  387. resolve!(() => template('resolved')())
  388. await timeout()
  389. expect(root.innerHTML).toBe('resolved<!--async component-->')
  390. })
  391. test('timeout without error component, but with loading component', async () => {
  392. let resolve: (comp: VaporComponent) => void
  393. const Foo = defineVaporAsyncComponent({
  394. loader: () =>
  395. new Promise(_resolve => {
  396. resolve = _resolve as any
  397. }),
  398. delay: 1,
  399. timeout: 16,
  400. loadingComponent: () => template('loading')(),
  401. })
  402. const root = document.createElement('div')
  403. const { app, mount } = define({
  404. setup() {
  405. return createComponent(Foo)
  406. },
  407. }).create()
  408. const handler = vi.fn()
  409. app.config.errorHandler = handler
  410. mount(root)
  411. expect(root.innerHTML).toBe('<!--async component-->')
  412. await timeout(1)
  413. expect(root.innerHTML).toBe('loading<!--async component-->')
  414. await timeout(16)
  415. expect(handler).toHaveBeenCalled()
  416. expect(handler.mock.calls[0][0].message).toMatch(
  417. `Async component timed out after 16ms.`,
  418. )
  419. // should still display loading
  420. expect(root.innerHTML).toBe('loading<!--async component-->')
  421. resolve!(() => template('resolved')())
  422. await timeout()
  423. expect(root.innerHTML).toBe('resolved<!--async component-->')
  424. })
  425. test('retry (success)', async () => {
  426. let loaderCallCount = 0
  427. let resolve: (comp: VaporComponent) => void
  428. let reject: (e: Error) => void
  429. const Foo = defineVaporAsyncComponent({
  430. loader: () => {
  431. loaderCallCount++
  432. return new Promise((_resolve, _reject) => {
  433. resolve = _resolve as any
  434. reject = _reject
  435. })
  436. },
  437. onError(error, retry, fail) {
  438. if (error.message.match(/foo/)) {
  439. retry()
  440. } else {
  441. fail()
  442. }
  443. },
  444. })
  445. const root = document.createElement('div')
  446. const { app, mount } = define({
  447. setup() {
  448. return createComponent(Foo)
  449. },
  450. }).create()
  451. const handler = (app.config.errorHandler = vi.fn())
  452. mount(root)
  453. expect(root.innerHTML).toBe('<!--async component-->')
  454. expect(loaderCallCount).toBe(1)
  455. const err = new Error('foo')
  456. reject!(err)
  457. await timeout()
  458. expect(handler).not.toHaveBeenCalled()
  459. expect(loaderCallCount).toBe(2)
  460. expect(root.innerHTML).toBe('<!--async component-->')
  461. // should render this time
  462. resolve!(() => template('resolved')())
  463. await timeout()
  464. expect(handler).not.toHaveBeenCalled()
  465. expect(root.innerHTML).toBe('resolved<!--async component-->')
  466. })
  467. test('retry (skipped)', async () => {
  468. let loaderCallCount = 0
  469. let reject: (e: Error) => void
  470. const Foo = defineVaporAsyncComponent({
  471. loader: () => {
  472. loaderCallCount++
  473. return new Promise((_resolve, _reject) => {
  474. reject = _reject
  475. })
  476. },
  477. onError(error, retry, fail) {
  478. if (error.message.match(/bar/)) {
  479. retry()
  480. } else {
  481. fail()
  482. }
  483. },
  484. })
  485. const root = document.createElement('div')
  486. const { app, mount } = define({
  487. setup() {
  488. return createComponent(Foo)
  489. },
  490. }).create()
  491. const handler = (app.config.errorHandler = vi.fn())
  492. mount(root)
  493. expect(root.innerHTML).toBe('<!--async component-->')
  494. expect(loaderCallCount).toBe(1)
  495. const err = new Error('foo')
  496. reject!(err)
  497. await timeout()
  498. // should fail because retryWhen returns false
  499. expect(handler).toHaveBeenCalled()
  500. expect(handler.mock.calls[0][0]).toBe(err)
  501. expect(loaderCallCount).toBe(1)
  502. expect(root.innerHTML).toBe('<!--async component-->')
  503. })
  504. test('retry (fail w/ max retry attempts)', async () => {
  505. let loaderCallCount = 0
  506. let reject: (e: Error) => void
  507. const Foo = defineVaporAsyncComponent({
  508. loader: () => {
  509. loaderCallCount++
  510. return new Promise((_resolve, _reject) => {
  511. reject = _reject
  512. })
  513. },
  514. onError(error, retry, fail, attempts) {
  515. if (error.message.match(/foo/) && attempts <= 1) {
  516. retry()
  517. } else {
  518. fail()
  519. }
  520. },
  521. })
  522. const root = document.createElement('div')
  523. const { app, mount } = define({
  524. setup() {
  525. return createComponent(Foo)
  526. },
  527. }).create()
  528. const handler = (app.config.errorHandler = vi.fn())
  529. mount(root)
  530. expect(root.innerHTML).toBe('<!--async component-->')
  531. expect(loaderCallCount).toBe(1)
  532. // first retry
  533. const err = new Error('foo')
  534. reject!(err)
  535. await timeout()
  536. expect(handler).not.toHaveBeenCalled()
  537. expect(loaderCallCount).toBe(2)
  538. expect(root.innerHTML).toBe('<!--async component-->')
  539. // 2nd retry, should fail due to reaching maxRetries
  540. reject!(err)
  541. await timeout()
  542. expect(handler).toHaveBeenCalled()
  543. expect(handler.mock.calls[0][0]).toBe(err)
  544. expect(loaderCallCount).toBe(2)
  545. expect(root.innerHTML).toBe('<!--async component-->')
  546. })
  547. test('template ref forwarding', async () => {
  548. let resolve: (comp: VaporComponent) => void
  549. const Foo = defineVaporAsyncComponent(
  550. () =>
  551. new Promise(r => {
  552. resolve = r as any
  553. }),
  554. )
  555. const fooRef = ref<any>(null)
  556. const toggle = ref(true)
  557. const root = document.createElement('div')
  558. const { mount } = define({
  559. setup() {
  560. return { fooRef, toggle }
  561. },
  562. render() {
  563. return createIf(
  564. () => toggle.value,
  565. () => {
  566. const setTemplateRef = createTemplateRefSetter()
  567. const n0 = createComponent(Foo, null, null, true)
  568. setTemplateRef(n0, 'fooRef')
  569. return n0
  570. },
  571. )
  572. },
  573. }).create()
  574. mount(root)
  575. expect(root.innerHTML).toBe('<!--async component--><!--if-->')
  576. expect(fooRef.value).toBe(null)
  577. resolve!({
  578. setup: (props, { expose }) => {
  579. expose({
  580. id: 'foo',
  581. })
  582. return template('resolved')()
  583. },
  584. })
  585. // first time resolve, wait for macro task since there are multiple
  586. // microtasks / .then() calls
  587. await timeout()
  588. expect(root.innerHTML).toBe('resolved<!--async component--><!--if-->')
  589. expect(fooRef.value.id).toBe('foo')
  590. toggle.value = false
  591. await nextTick()
  592. expect(root.innerHTML).toBe('<!--if-->')
  593. expect(fooRef.value).toBe(null)
  594. // already resolved component should update on nextTick
  595. toggle.value = true
  596. await nextTick()
  597. expect(root.innerHTML).toBe('resolved<!--async component--><!--if-->')
  598. expect(fooRef.value.id).toBe('foo')
  599. })
  600. test('the forwarded template ref should always exist when doing multi patching', async () => {
  601. let resolve: (comp: VaporComponent) => void
  602. const Foo = defineVaporAsyncComponent(
  603. () =>
  604. new Promise(r => {
  605. resolve = r as any
  606. }),
  607. )
  608. const fooRef = ref<any>(null)
  609. const toggle = ref(true)
  610. const updater = ref(0)
  611. const root = document.createElement('div')
  612. const { mount } = define({
  613. setup() {
  614. return { fooRef, toggle, updater }
  615. },
  616. render() {
  617. return createIf(
  618. () => toggle.value,
  619. () => {
  620. const setTemplateRef = createTemplateRefSetter()
  621. const n0 = createComponent(Foo, null, null, true)
  622. setTemplateRef(n0, 'fooRef')
  623. const n1 = template(`<span>`)()
  624. renderEffect(() => setElementText(n1, updater.value))
  625. return [n0, n1]
  626. },
  627. )
  628. },
  629. }).create()
  630. mount(root)
  631. expect(root.innerHTML).toBe('<!--async component--><span>0</span><!--if-->')
  632. expect(fooRef.value).toBe(null)
  633. resolve!({
  634. setup: (props, { expose }) => {
  635. expose({
  636. id: 'foo',
  637. })
  638. return template('resolved')()
  639. },
  640. })
  641. await timeout()
  642. expect(root.innerHTML).toBe(
  643. 'resolved<!--async component--><span>0</span><!--if-->',
  644. )
  645. expect(fooRef.value.id).toBe('foo')
  646. updater.value++
  647. await nextTick()
  648. expect(root.innerHTML).toBe(
  649. 'resolved<!--async component--><span>1</span><!--if-->',
  650. )
  651. expect(fooRef.value.id).toBe('foo')
  652. toggle.value = false
  653. await nextTick()
  654. expect(root.innerHTML).toBe('<!--if-->')
  655. expect(fooRef.value).toBe(null)
  656. })
  657. test.todo('with suspense', async () => {})
  658. test.todo('suspensible: false', async () => {})
  659. test.todo('suspense with error handling', async () => {})
  660. test.todo('with KeepAlive', async () => {})
  661. test.todo('with KeepAlive + include', async () => {})
  662. })