File tree Expand file tree Collapse file tree 3 files changed +38
-8
lines changed Expand file tree Collapse file tree 3 files changed +38
-8
lines changed Original file line number Diff line number Diff line change 1- import Vue from 'vue'
1+ import { shallowMount , createLocalVue } from '@vue/test-utils'
2+ import VueRouter from 'vue-router'
23import BootstrapVue from 'bootstrap-vue'
34import App from '@/App'
45
5- Vue . use ( BootstrapVue )
6+ const localVue = createLocalVue ( )
7+ localVue . use ( VueRouter )
8+ const router = new VueRouter ( )
9+
10+
11+ localVue . use ( BootstrapVue )
612
713describe ( 'App.vue' , ( ) => {
814 it ( 'has a name' , ( ) => {
915 expect ( App . name ) . toMatch ( 'app' )
1016 } )
17+ it ( 'is Vue instance' , ( ) => {
18+ const wrapper = shallowMount ( App , {
19+ localVue,
20+ router
21+ } )
22+ expect ( wrapper . isVueInstance ( ) ) . toBe ( true )
23+ } )
24+ it ( 'is App' , ( ) => {
25+ const wrapper = shallowMount ( App , {
26+ localVue,
27+ router
28+ } )
29+ expect ( wrapper . is ( App ) ) . toBe ( true )
30+ } )
1131} )
Original file line number Diff line number Diff line change 1- import Vue from 'vue'
21import BootstrapVue from 'bootstrap-vue'
2+ import { shallowMount , createLocalVue } from '@vue/test-utils'
3+ import VueRouter from 'vue-router'
34import DefaultContainer from '@/containers/DefaultContainer'
45
5- Vue . use ( BootstrapVue )
6+ const localVue = createLocalVue ( )
7+ localVue . use ( VueRouter )
8+ const router = new VueRouter ( )
9+
10+ localVue . use ( BootstrapVue )
611
712describe ( 'DefaultContainer.vue' , ( ) => {
813 it ( 'has a name' , ( ) => {
@@ -16,4 +21,11 @@ describe('DefaultContainer.vue', () => {
1621 const defaultData = DefaultContainer . data ( )
1722 expect ( typeof defaultData . nav ) . toMatch ( 'object' )
1823 } )
24+ it ( 'is Vue instance' , ( ) => {
25+ const wrapper = shallowMount ( DefaultContainer , {
26+ localVue,
27+ router
28+ } )
29+ expect ( wrapper . isVueInstance ( ) ) . toBe ( true )
30+ } )
1931} )
Original file line number Diff line number Diff line change 1- import Vue from 'vue'
21import { shallowMount , mount , createLocalVue } from '@vue/test-utils'
32import VueRouter from 'vue-router'
3+ import BootstrapVue from 'bootstrap-vue'
4+ import User from '@/views/Users/User'
45
56const localVue = createLocalVue ( )
67localVue . use ( VueRouter )
78const router = new VueRouter ( )
89
9- import BootstrapVue from 'bootstrap-vue'
10- import User from '@/views/Users/User'
11-
1210localVue . use ( BootstrapVue )
1311
1412describe ( 'User.vue' , ( ) => {
You can’t perform that action at this time.
0 commit comments