File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
test/unit/features/options Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ function initMethods (vm: Component) {
145145 if ( methods [ key ] != null ) {
146146 vm [ key ] = bind ( methods [ key ] , vm )
147147 } else if ( process . env . NODE_ENV !== 'production' ) {
148- warn ( `The method ${ key } on vue instance is undefined.` , vm )
148+ warn ( `Method " ${ key } " is undefined in options .` , vm )
149149 }
150150 }
151151 }
Original file line number Diff line number Diff line change @@ -15,4 +15,13 @@ describe('Options methods', () => {
1515 vm . plus ( )
1616 expect ( vm . a ) . toBe ( 2 )
1717 } )
18+
19+ it ( 'should warn undefined methods' , ( ) => {
20+ new Vue ( {
21+ methods : {
22+ hello : undefined
23+ }
24+ } )
25+ expect ( `Method "hello" is undefined in options` ) . toHaveBeenWarned ( )
26+ } )
1827} )
You can’t perform that action at this time.
0 commit comments