@@ -4,36 +4,35 @@ import { describe, expect, test } from 'vitest'
4
4
// BindingTypes,
5
5
// NodeTypes,
6
6
// } from '@vue/compiler-core'
7
- // import {
8
- // IRDynamicPropsKind,
9
- // IRNodeTypes,
10
- // transformChildren,
11
- // transformElement,
12
- // transformText,
13
- // transformVBind,
14
- // transformVOn,
15
- // } from '../../src/core/compiler/index'
16
- import { compile } from '../compile.spec'
17
- // import { makeCompile } from './_utils'
7
+ import {
8
+ // IRDynamicPropsKind,
9
+ // IRNodeTypes,
10
+ transformChildren ,
11
+ transformElement ,
12
+ transformText ,
13
+ transformVBind ,
14
+ transformVOn ,
15
+ } from '../../src/core/compiler/index'
16
+ import { makeCompile } from './_utils'
18
17
19
- const compileWithElementTransform = compile
20
- // makeCompile({
21
- // nodeTransforms: [transformElement, transformChildren, transformText],
22
- // directiveTransforms: {
23
- // bind: transformVBind,
24
- // on: transformVOn,
25
- // },
26
- // })
18
+ const compileWithElementTransform = makeCompile ( {
19
+ nodeTransforms : [ transformElement , transformChildren , transformText ] ,
20
+ directiveTransforms : {
21
+ bind : transformVBind ,
22
+ on : transformVOn ,
23
+ } ,
24
+ } )
27
25
28
26
describe ( 'compiler: element transform' , ( ) => {
29
27
describe ( 'component' , ( ) => {
30
28
test ( 'import + resolve component' , ( ) => {
31
29
const { code, vaporHelpers } = compileWithElementTransform ( `<Foo/>` )
32
30
expect ( code ) . toMatchInlineSnapshot ( `
33
- "import { createComponent as _createComponent } from 'vue/vapor';
31
+ "import { resolveComponent as _resolveComponent, createComponent as _createComponent } from 'vue/vapor';
34
32
35
33
export function render(_ctx) {
36
- const n0 = _createComponent(Foo, null, null, true)
34
+ const _component_Foo = _resolveComponent("Foo")
35
+ const n0 = _createComponent(_component_Foo, null, null, true)
37
36
return n0
38
37
}"
39
38
` )
0 commit comments