@@ -2,7 +2,7 @@ import { createLocalVue, config } from '~vue/test-utils'
22import Vue from 'vue'
33import Component from '~resources/components/component.vue'
44import ComponentWithVuex from '~resources/components/component-with-vuex.vue'
5- import { describeWithMountingMethods , vueVersion } from '~resources/utils'
5+ import { describeWithMountingMethods } from '~resources/utils'
66import { itDoNotRunIf } from 'conditional-specs'
77
88describeWithMountingMethods ( 'options.mocks' , mountingMethod => {
@@ -42,26 +42,27 @@ describeWithMountingMethods('options.mocks', mountingMethod => {
4242 expect ( HTML ) . contains ( 'http://test.com' )
4343 } )
4444
45- itDoNotRunIf (
46- vueVersion < 2.3 ,
47- 'adds variables to extended components' , ( ) => {
48- const TestComponent = Vue . extend ( {
49- template : `
45+ it ( 'adds variables to extended components' , ( ) => {
46+ const extendedComponent = Vue . extend ( {
47+ name : 'extended-component'
48+ } )
49+ const TestComponent = extendedComponent . extend ( {
50+ template : `
5051 <div>
5152 {{$route.path}}
5253 </div>
5354 `
54- } )
55- const $route = { path : 'http://test.com' }
56- const wrapper = mountingMethod ( TestComponent , {
57- mocks : {
58- $route
59- }
60- } )
61- const HTML =
62- mountingMethod . name === 'renderToString' ? wrapper : wrapper . html ( )
63- expect ( HTML ) . contains ( 'http://test.com' )
6455 } )
56+ const $route = { path : 'http://test.com' }
57+ const wrapper = mountingMethod ( TestComponent , {
58+ mocks : {
59+ $route
60+ }
61+ } )
62+ const HTML =
63+ mountingMethod . name === 'renderToString' ? wrapper : wrapper . html ( )
64+ expect ( HTML ) . contains ( 'http://test.com' )
65+ } )
6566
6667 // render returns a string so reactive does not apply
6768 itDoNotRunIf (
0 commit comments