Testing QQ Mini Program Component Transformations in dcloudio/uni-app
A comprehensive test suite for QQ Mini Program component transformations in uni-app, focusing on v-show directive handling and match-media component integration. The tests validate component rendering and directive transformations for the QQ platform implementation.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
dcloudio/uni-app
packages/uni-mp-qq/__tests__/component.spec.ts
import { assert } from './testUtils'
describe('mp-baidu: transform component', () => {
test(`component with v-show`, () => {
assert(
`<custom v-show="ok"/>`,
`<custom data-c-h="{{!a}}" u-i="2a9ec0b0-0" bind:__l="__l"/>`,
`(_ctx, _cache) => {
return { a: _ctx.ok }
}`
)
})
test(`match-media`, () => {
assert(
`<match-media/>`,
`<uni-match-media u-i="2a9ec0b0-0" bind:__l="__l"/>`,
`(_ctx, _cache) => {
return {}
}`
)
})
})