Skip to content

Instantly share code, notes, and snippets.

@eddyerburgh
Created July 22, 2017 05:51
Show Gist options
  • Select an option

  • Save eddyerburgh/0a303dafb78ddec121df3d0eafac67b8 to your computer and use it in GitHub Desktop.

Select an option

Save eddyerburgh/0a303dafb78ddec121df3d0eafac67b8 to your computer and use it in GitHub Desktop.
import { shallow, createLocalVue } from 'vue-test-utils'
import ComponentToTest from '@/components/ComponentsToTest'
const localVue = createLocalVue()
localVue.component('router-link')
localVue.mixin({
created: function () {
console.log('hello')
}
})
// tell shallow to use localVue
shallow(ComponentToTest, { localVue } // logs hello
shallow(ComponentToTest) // does not log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment