@@ -21,6 +21,7 @@ import PostCss from './components/PostCss.vue'
2121import Pug from './components/Pug.vue'
2222import PugRelative from './components/PugRelativeExtends.vue'
2323import Jsx from './components/Jsx.vue'
24+ import Constructor from './components/Constructor.vue'
2425
2526test ( 'processes .vue files' , ( ) => {
2627 const wrapper = mount ( Basic )
@@ -60,22 +61,27 @@ test('generates source maps using src attributes', () => {
6061
6162test ( 'processes .vue file using jsx' , ( ) => {
6263 const wrapper = mount ( Jsx )
63- expect ( wrapper . vm ) . toBeTruthy ( )
64+ expect ( wrapper . is ( 'div' ) ) . toBeTruthy ( )
65+ } )
66+
67+ test ( 'processes extended functions' , ( ) => {
68+ const wrapper = mount ( Constructor )
69+ expect ( wrapper . is ( 'div' ) ) . toBeTruthy ( )
6470} )
6571
6672test ( 'processes .vue file with lang set to coffee' , ( ) => {
6773 const wrapper = mount ( Coffee )
68- expect ( wrapper . vm ) . toBeTruthy ( )
74+ expect ( wrapper . is ( 'div' ) ) . toBeTruthy ( )
6975} )
7076
7177test ( 'processes .vue file with lang set to coffeescript' , ( ) => {
7278 const wrapper = mount ( CoffeeScript )
73- expect ( wrapper . vm ) . toBeTruthy ( )
79+ expect ( wrapper . is ( 'div' ) ) . toBeTruthy ( )
7480} )
7581
7682test ( 'processes .vue files with lang set to typescript' , ( ) => {
7783 const wrapper = mount ( TypeScript )
78- expect ( wrapper . vm ) . toBeTruthy ( )
84+ expect ( wrapper . is ( 'div' ) ) . toBeTruthy ( )
7985} )
8086
8187test ( 'processes functional components' , ( ) => {
@@ -102,30 +108,30 @@ test('handles missing script block', () => {
102108
103109test ( 'processes .vue file with jade template' , ( ) => {
104110 const wrapper = mount ( Jade )
105- expect ( wrapper . is ( 'div' ) ) . toBe ( true )
111+ expect ( wrapper . is ( 'div' ) ) . toBeTruthy ( )
106112 expect ( wrapper . classes ( ) ) . toContain ( 'jade' )
107113} )
108114
109115it ( 'processes Less' , ( ) => {
110116 const wrapper = mount ( Less )
111- expect ( wrapper . vm ) . toBeTruthy ( )
117+ expect ( wrapper . is ( 'div' ) ) . toBeTruthy ( )
112118} )
113119
114120it ( 'processes PostCSS' , ( ) => {
115121 const wrapper = mount ( PostCss )
116- expect ( wrapper . vm ) . toBeTruthy ( )
122+ expect ( wrapper . is ( 'div' ) ) . toBeTruthy ( )
117123} )
118124
119125test ( 'processes pug templates' , ( ) => {
120126 const wrapper = mount ( Pug )
121- expect ( wrapper . is ( 'div' ) ) . toBe ( true )
127+ expect ( wrapper . is ( 'div' ) ) . toBeTruthy ( )
122128 expect ( wrapper . classes ( ) ) . toContain ( 'pug-base' )
123129 expect ( wrapper . find ( '.pug-extended' ) . exists ( ) ) . toBeTruthy ( )
124130} )
125131
126132test ( 'supports relative paths when extending templates from .pug files' , ( ) => {
127133 const wrapper = mount ( PugRelative )
128- expect ( wrapper . is ( 'div' ) ) . toBe ( true )
134+ expect ( wrapper . is ( 'div' ) ) . toBeTruthy ( )
129135 expect ( wrapper . find ( '.pug-relative-base' ) . exists ( ) ) . toBeTruthy ( )
130136} )
131137
0 commit comments