import { compile } from '../src' describe('ssr: ', () => { test('basic', () => { expect(compile(``).code).toMatchInlineSnapshot(` "const { ssrRenderSlot: _ssrRenderSlot } = require(\\"@vue/server-renderer\\") return function ssrRender(_ctx, _push, _parent, _attrs) { _ssrRenderSlot(_ctx.$slots, \\"default\\", {}, null, _push, _parent) }" `) }) test('with name', () => { expect(compile(``).code).toMatchInlineSnapshot(` "const { ssrRenderSlot: _ssrRenderSlot } = require(\\"@vue/server-renderer\\") return function ssrRender(_ctx, _push, _parent, _attrs) { _ssrRenderSlot(_ctx.$slots, \\"foo\\", {}, null, _push, _parent) }" `) }) test('with dynamic name', () => { expect(compile(``).code).toMatchInlineSnapshot(` "const { ssrRenderSlot: _ssrRenderSlot } = require(\\"@vue/server-renderer\\") return function ssrRender(_ctx, _push, _parent, _attrs) { _ssrRenderSlot(_ctx.$slots, _ctx.bar.baz, {}, null, _push, _parent) }" `) }) test('with props', () => { expect(compile(``).code) .toMatchInlineSnapshot(` "const { ssrRenderSlot: _ssrRenderSlot } = require(\\"@vue/server-renderer\\") return function ssrRender(_ctx, _push, _parent, _attrs) { _ssrRenderSlot(_ctx.$slots, \\"foo\\", { p: 1, bar: \\"2\\" }, null, _push, _parent) }" `) }) test('with fallback', () => { expect(compile(`some {{ fallback }} content`).code) .toMatchInlineSnapshot(` "const { ssrRenderSlot: _ssrRenderSlot, ssrInterpolate: _ssrInterpolate } = require(\\"@vue/server-renderer\\") return function ssrRender(_ctx, _push, _parent, _attrs) { _ssrRenderSlot(_ctx.$slots, \\"default\\", {}, () => { _push(\`some \${_ssrInterpolate(_ctx.fallback)} content\`) }, _push, _parent) }" `) }) })