File tree 1 file changed +7
-1
lines changed
test/unit/modules/compiler
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,6 @@ describe('compile options', () => {
131
131
expect ( compiled . errors . length ) . toBe ( 1 )
132
132
expect ( compiled . errors [ 0 ] . start ) . toBe ( 0 )
133
133
expect ( compiled . errors [ 0 ] . end ) . toBeUndefined ( )
134
- expect ( compiled . errors [ 0 ] . msg ) . toContain ( 'root element' )
135
134
136
135
compiled = compile ( '<div v-if="a----">{{ b++++ }}</div>' , { outputSourceRange : true } )
137
136
expect ( compiled . errors . length ) . toBe ( 2 )
@@ -140,4 +139,11 @@ describe('compile options', () => {
140
139
expect ( compiled . errors [ 1 ] . start ) . toBe ( 18 )
141
140
expect ( compiled . errors [ 1 ] . end ) . toBe ( 29 )
142
141
} )
142
+
143
+ it ( 'should collect source range for binding keys' , ( ) => {
144
+ const compiled = compile ( '<div><slot v-bind:key="key" /></div>' , { outputSourceRange : true } )
145
+ expect ( compiled . errors . length ) . toBe ( 1 )
146
+ expect ( compiled . errors [ 0 ] . start ) . toBe ( 11 )
147
+ expect ( compiled . errors [ 0 ] . end ) . toBe ( 27 )
148
+ } )
143
149
} )
You can’t perform that action at this time.
0 commit comments