example.spec.ts 335 B

123456789101112
  1. import { shallowMount } from '@vue/test-utils'
  2. import HelloWorld from '@/components/HelloWorld.vue'
  3. describe('HelloWorld.vue', () => {
  4. it('renders props.msg when passed', () => {
  5. const msg = 'new message'
  6. const wrapper = shallowMount(HelloWorld, {
  7. props: { msg }
  8. })
  9. expect(wrapper.text()).toMatch(msg)
  10. })
  11. })