Skip to content

Instantly share code, notes, and snippets.

@xrd
Created May 29, 2019 20:40
Show Gist options
  • Save xrd/224b06c56f63dc30b73597d801d5aff4 to your computer and use it in GitHub Desktop.
Save xrd/224b06c56f63dc30b73597d801d5aff4 to your computer and use it in GitHub Desktop.
test/unit/specs/HelloWorld.spec.js
import Vue from 'vue'
import HelloWorld from '@/components/HelloWorld'
describe('HelloWorld.vue', () => {
it('should render correct contents', () => {
const Constructor = Vue.extend(HelloWorld)
const vm = new Constructor().$mount()
expect(vm.$el.querySelector('.hello h1').textContent)
.toEqual('Welcome to Your Vue.js App')
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment