Skip to content

Commit 9cfd63a

Browse files
committed
fix weex tests
1 parent 28ec3c7 commit 9cfd63a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/weex/compiler/compile.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ import { compile } from '../../../packages/weex-template-compiler'
33
describe('compile basic', () => {
44
it('should be compiled', () => {
55
const { render, staticRenderFns, errors } = compile(`<div>{{hi}}</div>`)
6-
expect(render).toEqual(`with(this){return _h('div',[_s(hi)])}`)
6+
expect(render).toEqual(`with(this){return _c('div',[_v(_s(hi))])}`)
77
expect(staticRenderFns.length).toBe(0)
88
expect(errors).toEqual([])
99
})
1010

1111
it('should compile data bindings', () => {
1212
const { render, staticRenderFns, errors } = compile(`<div :a="b"></div>`)
13-
expect(render).toEqual(`with(this){return _h('div',{attrs:{"a":b}})}`)
13+
expect(render).toEqual(`with(this){return _c('div',{attrs:{"a":b}})}`)
1414
expect(staticRenderFns).toEqual([])
1515
expect(errors).toEqual([])
1616
})
1717

1818
it('should compile event bindings', () => {
1919
const { render, staticRenderFns, errors } = compile(`<div @click="x"></div>`)
20-
expect(render).toEqual(`with(this){return _h('div',{on:{"click":x}})}`)
20+
expect(render).toEqual(`with(this){return _c('div',{on:{"click":x}})}`)
2121
expect(staticRenderFns).toEqual([])
2222
expect(errors).toEqual([])
2323
})
2424

2525
it('should compile data bindings with children', () => {
2626
const { render, staticRenderFns, errors } = compile(`<foo :a="b"><text>Hello</text></foo>`)
27-
expect(render).toEqual(`with(this){return _h('foo',{attrs:{"a":b}},[_h('text',["Hello"])])}`)
27+
expect(render).toEqual(`with(this){return _c('foo',{attrs:{"a":b}},[_c('text',[_v("Hello")])])}`)
2828
expect(staticRenderFns).toEqual([])
2929
expect(errors).toEqual([])
3030
})
@@ -38,7 +38,7 @@ describe('compile basic', () => {
3838
<text style="margin-left:36px;color:#eee;">Load more...</text>
3939
</refresh>
4040
`)
41-
expect(render).toEqual(`with(this){return _h('refresh',{staticClass:["refresh"],staticStyle:{flexDirection:"row"},attrs:{"display":displayRefresh},on:{"refresh":handleRefresh}},[_h('loading-indicator'),_h('text',{staticStyle:{marginLeft:"36px",color:"#eee"}},["Load more..."])])}`)
41+
expect(render).toEqual(`with(this){return _c('refresh',{staticClass:["refresh"],staticStyle:{flexDirection:"row"},attrs:{"display":displayRefresh},on:{"refresh":handleRefresh}},[_c('loading-indicator'),_c('text',{staticStyle:{marginLeft:"36px",color:"#eee"}},[_v("Load more...")])])}`)
4242
expect(staticRenderFns).toEqual([])
4343
expect(errors).toEqual([])
4444
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy