Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR support (render) #507

Closed
lmiller1990 opened this issue Mar 30, 2021 · 6 comments
Closed

SSR support (render) #507

lmiller1990 opened this issue Mar 30, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@lmiller1990
Copy link
Member

We should support render, for SSR: https://vue-test-utils.vuejs.org/api/#render

@samturrell
Copy link

Migrating from vue 2 to vue 3, and this seems to be a missing feature in the test utils. Is this something that is actively planned to be reintroduced?

@cexbrayat
Copy link
Member

@samturrell Yes, there is an open PR from a contributor that should land as a first step to support SSR. See #1572

@lmiller1990
Copy link
Member Author

@samturrell if you want to pick up where the original author in #1572 left off, that'd be great! I think we just need to rebase and get his branch green, and we can release something to get feedback and testing.

@freakzlike
Copy link
Collaborator

renderToString has been added with #1971
https://test-utils.vuejs.org/guide/advanced/ssr.html

@craigrileyuk
Copy link

This is a good addition, but I assume it's an emulated function rather than an adapted version of the proper renderToString function since it fails in a NodeJS envrionment. For example:

// @vitest-environment node

at the top of your test file gets you a ReferenceError: document is not defined from vue-test-utils.esm-bundler.mjs.

@lmiller1990
Copy link
Member Author

Hm, should document be defined in that context? Test Utils assumes document exists.

Any recommendation for how renderToString should be implemented here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants