wip(ssr): should apply app context when rendering app instance
This commit is contained in:
@@ -1,7 +1,28 @@
|
||||
import { createApp, h, createCommentVNode, withScopeId } from 'vue'
|
||||
import {
|
||||
createApp,
|
||||
h,
|
||||
createCommentVNode,
|
||||
withScopeId,
|
||||
resolveComponent,
|
||||
ComponentOptions
|
||||
} from 'vue'
|
||||
import { renderToString, renderComponent, renderSlot, escapeHtml } from '../src'
|
||||
|
||||
describe('ssr: renderToString', () => {
|
||||
test('should apply app context', async () => {
|
||||
const app = createApp({
|
||||
render() {
|
||||
const Foo = resolveComponent('foo') as ComponentOptions
|
||||
return h(Foo)
|
||||
}
|
||||
})
|
||||
app.component('foo', {
|
||||
render: () => h('div', 'foo')
|
||||
})
|
||||
const html = await renderToString(app)
|
||||
expect(html).toBe(`<div>foo</div>`)
|
||||
})
|
||||
|
||||
describe('components', () => {
|
||||
test('vnode components', async () => {
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user