@@ -986,48 +986,44 @@ describe('vue-loader', function () {
986986 } )
987987 } )
988988
989- // Vue required tests for more complete test cases
990- // this test case requires Vue >= 2.5
991- if ( Number ( Vue . version . split ( '.' ) [ 1 ] ) >= 5 ) {
992- it ( 'functional template' , done => {
993- test ( {
994- entry : './test/fixtures/functional-root.vue' ,
995- vue : {
996- preserveWhitespace : false
989+ it ( 'functional template' , done => {
990+ test ( {
991+ entry : './test/fixtures/functional-root.vue' ,
992+ vue : {
993+ preserveWhitespace : false
994+ }
995+ } , ( window , module ) => {
996+ expect ( module . components . Functional . _compiled ) . to . equal ( true )
997+ expect ( module . components . Functional . functional ) . to . equal ( true )
998+ expect ( module . components . Functional . staticRenderFns ) . to . exist
999+ expect ( module . components . Functional . render ) . to . be . a ( 'function' )
1000+
1001+ const vnode = mockRender ( module , {
1002+ fn ( ) {
1003+ done ( )
9971004 }
998- } , ( window , module ) => {
999- expect ( module . components . Functional . _compiled ) . to . equal ( true )
1000- expect ( module . components . Functional . functional ) . to . equal ( true )
1001- expect ( module . components . Functional . staticRenderFns ) . to . exist
1002- expect ( module . components . Functional . render ) . to . be . a ( 'function' )
1003-
1004- const vnode = mockRender ( module , {
1005- fn ( ) {
1006- done ( )
1007- }
1008- } ) . children [ 0 ]
1009-
1010- // Basic vnode
1011- expect ( vnode . children [ 0 ] . data . staticClass ) . to . equal ( 'red' )
1012- expect ( vnode . children [ 0 ] . children [ 0 ] . text ) . to . equal ( 'hello' )
1013- // Default slot vnode
1014- expect ( vnode . children [ 1 ] . tag ) . to . equal ( 'span' )
1015- expect ( vnode . children [ 1 ] . children [ 0 ] . text ) . to . equal ( 'hello' )
1016- // Named slot vnode
1017- expect ( vnode . children [ 2 ] . tag ) . to . equal ( 'div' )
1018- expect ( vnode . children [ 2 ] . children [ 0 ] . text ) . to . equal ( 'Second slot' )
1019- // // Scoped slot vnode
1020- expect ( vnode . children [ 3 ] . text ) . to . equal ( 'hello' )
1021- // // Static content vnode
1022- expect ( vnode . children [ 4 ] . tag ) . to . equal ( 'div' )
1023- expect ( vnode . children [ 4 ] . children [ 0 ] . text ) . to . equal ( 'Some ' )
1024- expect ( vnode . children [ 4 ] . children [ 1 ] . tag ) . to . equal ( 'span' )
1025- expect ( vnode . children [ 4 ] . children [ 1 ] . children [ 0 ] . text ) . to . equal ( 'text' )
1026- // // v-if vnode
1027- expect ( vnode . children [ 5 ] . text ) . to . equal ( '' )
1028-
1029- vnode . children [ 6 ] . data . on . click ( )
1030- } )
1005+ } ) . children [ 0 ]
1006+
1007+ // Basic vnode
1008+ expect ( vnode . children [ 0 ] . data . staticClass ) . to . equal ( 'red' )
1009+ expect ( vnode . children [ 0 ] . children [ 0 ] . text ) . to . equal ( 'hello' )
1010+ // Default slot vnode
1011+ expect ( vnode . children [ 1 ] . tag ) . to . equal ( 'span' )
1012+ expect ( vnode . children [ 1 ] . children [ 0 ] . text ) . to . equal ( 'hello' )
1013+ // Named slot vnode
1014+ expect ( vnode . children [ 2 ] . tag ) . to . equal ( 'div' )
1015+ expect ( vnode . children [ 2 ] . children [ 0 ] . text ) . to . equal ( 'Second slot' )
1016+ // // Scoped slot vnode
1017+ expect ( vnode . children [ 3 ] . text ) . to . equal ( 'hello' )
1018+ // // Static content vnode
1019+ expect ( vnode . children [ 4 ] . tag ) . to . equal ( 'div' )
1020+ expect ( vnode . children [ 4 ] . children [ 0 ] . text ) . to . equal ( 'Some ' )
1021+ expect ( vnode . children [ 4 ] . children [ 1 ] . tag ) . to . equal ( 'span' )
1022+ expect ( vnode . children [ 4 ] . children [ 1 ] . children [ 0 ] . text ) . to . equal ( 'text' )
1023+ // // v-if vnode
1024+ expect ( vnode . children [ 5 ] . text ) . to . equal ( '' )
1025+
1026+ vnode . children [ 6 ] . data . on . click ( )
10311027 } )
1032- }
1028+ } )
10331029} )
0 commit comments