Skip to content

Commit

Permalink
test(transformer): preval 可用
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Dec 17, 2019
1 parent e6910db commit 4282768
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/taro-transformer-wx/__tests__/template.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,29 @@ describe('Template', () => {
)
})

test('第三方组件事件首字母小写 preval', () => {
const { template } = transform({
...baseOptions,
code: buildComponent(
`
const { list } = this.state
return (
<ec-chart onChange={this.handleChange} />
)
`,
`config = { usingComponents: preval\` module.exports= { 'ec-chart': '../path' } \` }`
)
})

expect(template).toMatch(
prettyPrint(`
<block>
<ec-chart bindchange="handleChange"></ec-chart>
</block>
`)
)
})

test('第三方组件事件首字母小写 2', () => {
const { template } = transform({
...baseOptions,
Expand Down

0 comments on commit 4282768

Please sign in to comment.