const compiler = require('../lib')
function assertCodegen (template, templateCode, renderCode = 'with(this){}', options = {}) {
const res = compiler.compile(template, {
resourcePath: 'test.wxml',
mp: Object.assign({
minified: true,
isTest: true,
platform: 'mp-toutiao'
}, options)
})
expect(res.template).toBe(templateCode)
expect(res.render).toBe(renderCode)
}
describe('mp:compiler-mp-toutiao', () => {
it('generate v-for directive', () => {
assertCodegen(
'
2
', '3
', '4
', '5
', '7
', '8
', ' ' ) assertCodegen( '9
', '