@@ -60,7 +60,9 @@ function createStubFromString (templateString: string, originalComponent: Compon
60
60
function createBlankStub ( originalComponent : Component ) {
61
61
return {
62
62
...getCoreProperties ( originalComponent ) ,
63
- render : h => h ( '' )
63
+ render ( h ) {
64
+ return h ( `${ originalComponent . name } -stub` )
65
+ }
64
66
}
65
67
}
66
68
@@ -78,7 +80,7 @@ export function createComponentStubs (originalComponents: Object = {}, stubs: Ob
78
80
if ( typeof stub !== 'string' ) {
79
81
throwError ( 'each item in an options.stubs array must be a string' )
80
82
}
81
- components [ stub ] = createBlankStub ( { } )
83
+ components [ stub ] = createBlankStub ( { name : stub } )
82
84
} )
83
85
} else {
84
86
Object . keys ( stubs ) . forEach ( stub => {
@@ -89,7 +91,7 @@ export function createComponentStubs (originalComponents: Object = {}, stubs: Ob
89
91
throwError ( 'options.stub values must be passed a string or component' )
90
92
}
91
93
if ( stubs [ stub ] === true ) {
92
- components [ stub ] = createBlankStub ( { } )
94
+ components [ stub ] = createBlankStub ( { name : stub } )
93
95
return
94
96
}
95
97
@@ -124,7 +126,7 @@ export function createComponentStubs (originalComponents: Object = {}, stubs: Ob
124
126
}
125
127
// ignoreElements does not exist in Vue 2.0.x
126
128
if ( Vue . config . ignoredElements ) {
127
- Vue . config . ignoredElements . push ( stub )
129
+ Vue . config . ignoredElements . push ( ` ${ stub } -stub` )
128
130
}
129
131
} )
130
132
}
@@ -142,7 +144,7 @@ function stubComponents (components: Object, stubbedComponents: Object) {
142
144
143
145
// ignoreElements does not exist in Vue 2.0.x
144
146
if ( Vue . config . ignoredElements ) {
145
- Vue . config . ignoredElements . push ( component )
147
+ Vue . config . ignoredElements . push ( ` ${ components [ component ] . name } -stub` )
146
148
}
147
149
} )
148
150
}
0 commit comments