Skip to content

Instantly share code, notes, and snippets.

@brpaz
Created March 12, 2019 21:52
Show Gist options
  • Save brpaz/7deb2da103e30605537eebf0672f501b to your computer and use it in GitHub Desktop.
Save brpaz/7deb2da103e30605537eebf0672f501b to your computer and use it in GitHub Desktop.
#vuejs #testing
import { shallowMount } from '@vue/test-utils';
import HelloWorld from '@/components/HelloWorld.vue';
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message';
const wrapper = shallowMount(HelloWorld, {
propsData: { msg },
});
expect(wrapper.text()).toMatch(msg);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment