Created
July 22, 2017 05:51
-
-
Save eddyerburgh/0a303dafb78ddec121df3d0eafac67b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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