Skip to content

Commit dc58676

Browse files
committed
refactor: extract component options
1 parent 2648213 commit dc58676

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/create-instance/create-instance.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ export default function createInstance (
104104
component.options._base = _Vue
105105
}
106106

107+
const componentOptions = typeof component === 'function'
108+
? component.options
109+
: component
107110
// extend component from _Vue to add properties and mixins
108111
// extend does not work correctly for sub class components in Vue < 2.2
109-
const Constructor = typeof component === 'function'
110-
? _Vue.extend(component.options).extend(instanceOptions)
111-
: _Vue.extend(component).extend(instanceOptions)
112+
const Constructor = _Vue.extend(componentOptions).extend(instanceOptions)
112113

113114
// used to identify extended component using constructor
114115
Constructor.options.$_vueTestUtils_original = component

0 commit comments

Comments
 (0)