File tree 2 files changed +22
-18
lines changed
test/unit/features/options
2 files changed +22
-18
lines changed Original file line number Diff line number Diff line change @@ -395,7 +395,7 @@ export function mergeOptions (
395
395
}
396
396
397
397
if ( typeof child === 'function' ) {
398
- child = child . extendOptions
398
+ child = child . options
399
399
}
400
400
401
401
normalizeProps ( child , vm )
Original file line number Diff line number Diff line change @@ -110,31 +110,35 @@ describe('Options mixins', () => {
110
110
expect ( vm . $options . directives . c ) . toBeDefined ( )
111
111
} )
112
112
113
- it ( 'should not mix global mixined lifecycle hook twice' , ( ) => {
114
- const spy = jasmine . createSpy ( 'global mixed in lifecycle hook' )
115
- Vue . mixin ( {
116
- created ( ) {
117
- spy ( )
118
- }
119
- } )
113
+ it ( 'should accept further extended constructors as mixins' , ( ) => {
114
+ const spy1 = jasmine . createSpy ( 'mixinA' )
115
+ const spy2 = jasmine . createSpy ( 'mixinB' )
120
116
121
- const mixin1 = Vue . extend ( {
117
+ const mixinA = Vue . extend ( {
118
+ created : spy1 ,
119
+ directives : {
120
+ c : { }
121
+ } ,
122
122
methods : {
123
- a ( ) { }
123
+ a : function ( ) { }
124
124
}
125
125
} )
126
126
127
- const mixin2 = Vue . extend ( {
128
- mixins : [ mixin1 ] ,
127
+ const mixinB = mixinA . extend ( {
128
+ created : spy2
129
129
} )
130
130
131
- const Child = Vue . extend ( {
132
- mixins : [ mixin2 ] ,
131
+ const vm = new Vue ( {
132
+ mixins : [ mixinB ] ,
133
+ methods : {
134
+ b : function ( ) { }
135
+ }
133
136
} )
134
137
135
- const vm = new Child ( )
136
-
137
- expect ( typeof vm . $options . methods . a ) . toBe ( 'function' )
138
- expect ( spy . calls . count ( ) ) . toBe ( 1 )
138
+ expect ( spy1 ) . toHaveBeenCalledTimes ( 1 )
139
+ expect ( spy2 ) . toHaveBeenCalledTimes ( 1 )
140
+ expect ( vm . a ) . toBeDefined ( )
141
+ expect ( vm . b ) . toBeDefined ( )
142
+ expect ( vm . $options . directives . c ) . toBeDefined ( )
139
143
} )
140
144
} )
You can’t perform that action at this time.
0 commit comments