File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
var _ = require ( 'src/util' )
2
+ var Vue = require ( 'src' )
2
3
var config = require ( 'src/config' )
3
4
var warnPrefix = '[Vue warn]: '
4
5
@@ -15,6 +16,15 @@ if (typeof console !== 'undefined') {
15
16
expect ( console . error ) . toHaveBeenCalledWith ( warnPrefix + 'oops' )
16
17
} )
17
18
19
+ it ( 'format component name' , function ( ) {
20
+ config . silent = false
21
+ _ . warn . and . callThrough ( )
22
+ _ . warn ( 'oops' , new Vue ( { name : 'hi' } ) )
23
+ expect ( console . error ) . toHaveBeenCalledWith ( warnPrefix + 'oops (found in component: <hi>)' )
24
+ _ . warn ( 'oops' , { name : 'ho' } )
25
+ expect ( console . error ) . toHaveBeenCalledWith ( warnPrefix + 'oops (found in component: <ho>)' )
26
+ } )
27
+
18
28
it ( 'not warn when silent is ture' , function ( ) {
19
29
config . silent = true
20
30
_ . warn . and . callThrough ( )
You can’t perform that action at this time.
0 commit comments