Skip to content

Commit ebf3f4f

Browse files
authored
test: fix broken test (#835)
1 parent 42c15d5 commit ebf3f4f

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

Diff for: test/specs/mounting-options/localVue.spec.js

+7-16
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,17 @@ describeWithMountingMethods('options.localVue', mountingMethod => {
1414
'mounts component using passed localVue as base Vue',
1515
() => {
1616
const TestComponent = {
17-
template: `
18-
<div>{{test}}</div>
19-
`,
20-
data: { test: '' }
17+
template: `<div>{{test}}</div>`
2118
}
22-
const localVue = Vue.extend()
23-
localVue.version = '2.3'
19+
const localVue = createLocalVue()
20+
localVue.prototype.test = 'some value'
2421
const wrapper = mountingMethod(TestComponent, {
25-
localVue: localVue,
26-
mocks: { test: 'some value' }
22+
localVue: localVue
2723
})
28-
const HTML =
29-
mountingMethod.name === 'renderToString' ? wrapper : wrapper.html()
24+
const HTML = mountingMethod.name === 'renderToString'
25+
? wrapper
26+
: wrapper.html()
3027
expect(HTML).to.contain('some value')
31-
const freshWrapper = mountingMethod(TestComponent)
32-
const freshHTML =
33-
mountingMethod.name === 'renderToString'
34-
? freshWrapper
35-
: freshWrapper.html()
36-
expect(freshHTML).to.not.contain('some value')
3728
}
3829
)
3930

0 commit comments

Comments
 (0)