Skip to content

Instantly share code, notes, and snippets.

@eddyerburgh
Created July 21, 2017 16:13
Show Gist options
  • Save eddyerburgh/c4771de9f0fdde1ef995a2cadd5c00ba to your computer and use it in GitHub Desktop.
Save eddyerburgh/c4771de9f0fdde1ef995a2cadd5c00ba to your computer and use it in GitHub Desktop.
import { shallow } from 'vue-test-utils'
import ComponentWithChildren from '@/components/ComponentWithSlots'
import ChildComponent from '@/components/AnotherComponent'
// shallow mount the component
const wrapper = mount(ComponentWithChildren)
// you can still find the child component, but it doesn't render any nodes
const childComponent = wrapper.find(ChildComponent)
// make assertions
expect(childComponent.hasProp('foo', 'bar')).to.equal(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment