component.spec.ts 549 字节
Newer Older
fxy060608's avatar
fxy060608 已提交
1 2
import { assert } from './testUtils'

fxy060608's avatar
fxy060608 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
describe('mp-weixin: transform component', () => {
  test('lazy element', () => {
    assert(
      `<editor/>`,
      `<editor/>`,
      `(_ctx, _cache) => {
  return {}
}`
    )
    assert(
      `<editor @ready="ready"/>`,
      `<block wx:if="{{r0}}"><editor bindready="{{a}}"/></block>`,
      `(_ctx, _cache) => {
  return { a: _o(_ctx.ready) }
}`
    )
  })
fxy060608's avatar
fxy060608 已提交
20 21 22 23 24 25 26 27 28 29
  test(`match-media`, () => {
    assert(
      `<match-media/>`,
      `<match-media/>`,
      `(_ctx, _cache) => {
  return {}
}`
    )
  })
})