Browse Source

test: fix weex test case

dev
Evan You 7 years ago
parent
commit
904d9c9a81
  1. 6
      test/weex/compiler/compile.spec.js

6
test/weex/compiler/compile.spec.js

@ -32,12 +32,12 @@ describe('compile basic', () => {
it('should compile unary tag', () => {
const inputCase = compile(`<div><input><text>abc</text></div>`)
expect(inputCase.render).toMatch(strToRegExp(`return _m(0,false,false)`))
expect(inputCase.render).toMatch(strToRegExp(`return _m(0)`))
expect(inputCase.staticRenderFns).toMatch(strToRegExp(`_c('div',[_c('input'),_c('text',[_v("abc")])])`))
expect(inputCase.errors).toEqual([])
const imageCase = compile(`<div><image src="path"><text>abc</text></div>`)
expect(imageCase.render).toMatch(strToRegExp(`return _m(0,false,false)`))
expect(imageCase.render).toMatch(strToRegExp(`return _m(0)`))
expect(imageCase.staticRenderFns).toMatch(strToRegExp(`_c('div',[_c('image',{attrs:{"src":"path"}}),_c('text',[_v("abc")])])`))
expect(imageCase.errors).toEqual([])
@ -54,7 +54,7 @@ describe('compile basic', () => {
</div>
</div>
`)
expect(complexCase.render).toMatch(strToRegExp(`return _m(0,false,false)`))
expect(complexCase.render).toMatch(strToRegExp(`return _m(0)`))
expect(complexCase.staticRenderFns).toMatch(strToRegExp(`_c('image',{attrs:{"src":"path"}}),_c('image'),_c('div'`))
expect(complexCase.staticRenderFns).toMatch(strToRegExp(`_c('div',[_c('embed'),_c('text',[_v("start")]),_c('input',{attrs:{"type":"text"}}),_c('input',{attrs:{"type":"url"}}),_c('text',[_v("end")])]`))
expect(complexCase.errors).toEqual([])

Loading…
Cancel
Save