File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ export default {
139139 messageId : 'wrongOrder' ,
140140 data : {
141141 currentBlock : block . type ,
142- expected : 'after ' ,
142+ expected : 'before ' ,
143143 otherBlock : expectedPreviousType ,
144144 } ,
145145 } )
Original file line number Diff line number Diff line change @@ -118,6 +118,10 @@ export default { name: 'Test' }
118118 const wrongOrderErrors = testRule ( invalidSfc2 ) // template before script with script-first order
119119 expect ( wrongOrderErrors ) . toHaveLength ( 1 )
120120 expect ( wrongOrderErrors [ 0 ] . messageId ) . toBe ( 'wrongOrder' )
121+ // Verify the error message is correct: script should come before template
122+ expect ( wrongOrderErrors [ 0 ] . data . currentBlock ) . toBe ( 'script' )
123+ expect ( wrongOrderErrors [ 0 ] . data . expected ) . toBe ( 'before' )
124+ expect ( wrongOrderErrors [ 0 ] . data . otherBlock ) . toBe ( 'template' )
121125
122126 const invalidSfc3 = `<script>
123127export default { name: 'Test' }
You can’t perform that action at this time.
0 commit comments