message: test(ssr): test async components
diff: @@ -9,8 +9,9 @@ import {
  ssrRenderComponent,
  } from '@vue/server-renderer'
  +const delay = (t: number) => new Promise(resolve => setTimeout(resolve, t))
  +
  describe('SSR', () => {
  - it('works', async () => {
  const Home = {
  ssrRender(ctx: any, push: any) {
  push('Home')
  @@ -22,6 +23,12 @@ describe('SSR', () => {
  },
  }
  + const AsyncPage = async () => {
  + await delay(10)
  + return Page
  + }
  +
  + it('works', async () => {
  const router = createRouter({
  history: createMemoryHistory(),
  routes: [
  @@ -55,4 +62,39 @@ describe('SSR', () => {
  const xxx = await renderToString(app)
  expect(xxx).toMatchInlineSnapshot(`"/hello"`)
  })
  +
  + it('handles async components', async () => {
  + const router = createRouter({
  + history: createMemoryHistory(),
  + routes: [
  + { path: '/', component: Home },
  + {
  + path: '/:id',
  + component: AsyncPage,
  + },
  + ],
  + })
  + const App = {
  + ssrRender(ctx: any, push: any, parent: any) {
  + push(
  + ssrRenderComponent(
  + resolveComponent('router-view') as Component,
  + null,
  + null,
  + parent
  + )
  + )
  + },
  + }
  + const app = createSSRApp(App)
  + app.use(router)
  + // const rootEl = document.createElement('div')
  + // document.body.appendChild(rootEl)
  +
  + router.push('/hello')
  + await router.isReady()
  +
  + const xxx = await renderToString(app)
  + expect(xxx).toMatchInlineSnapshot(`"/hello"`)
  + })
  })
  