import { compile } from '../src'
describe('ssr compile: teleport', () => {
test('should work', () => {
expect(compile(``).code)
.toMatchInlineSnapshot(`
"const { ssrRenderTeleport: _ssrRenderTeleport } = require(\\"@vue/server-renderer\\")
return function ssrRender(_ctx, _push, _parent, _attrs) {
_ssrRenderTeleport(_push, (_push) => {
_push(\`
\`)
}, _ctx.target, false, _parent)
}"
`)
})
test('disabled prop handling', () => {
expect(compile(``).code)
.toMatchInlineSnapshot(`
"const { ssrRenderTeleport: _ssrRenderTeleport } = require(\\"@vue/server-renderer\\")
return function ssrRender(_ctx, _push, _parent, _attrs) {
_ssrRenderTeleport(_push, (_push) => {
_push(\`\`)
}, _ctx.target, true, _parent)
}"
`)
expect(
compile(``).code
).toMatchInlineSnapshot(`
"const { ssrRenderTeleport: _ssrRenderTeleport } = require(\\"@vue/server-renderer\\")
return function ssrRender(_ctx, _push, _parent, _attrs) {
_ssrRenderTeleport(_push, (_push) => {
_push(\`\`)
}, _ctx.target, _ctx.foo, _parent)
}"
`)
})
})