Skip to content

Instantly share code, notes, and snippets.

@znck
Created November 24, 2017 08:41
Show Gist options
  • Save znck/1b95a991e63fcae36be78b1d46e21ea7 to your computer and use it in GitHub Desktop.
Save znck/1b95a991e63fcae36be78b1d46e21ea7 to your computer and use it in GitHub Desktop.
import { mount } from 'vue-test-utils'
import { createRenderer } from 'vue-server-renderer'
import MyComponent from './MyComponent.vue'
const renderer = createRenderer()
renderer.renderToString(
mount(MyComponent).vm,
(error, html) => {
if (error) throw new Error(error)
// validate: html
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment