chore(compiler-core/codegen): avoid generate indent spaces of empty lines. (#701)
This commit is contained in:
@@ -119,10 +119,11 @@ describe('compiler: codegen', () => {
|
||||
expect(code).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('assets', () => {
|
||||
test('assets + temps', () => {
|
||||
const root = createRoot({
|
||||
components: [`Foo`, `bar-baz`, `barbaz`],
|
||||
directives: [`my_dir`]
|
||||
directives: [`my_dir_0`, `my_dir_1`],
|
||||
temps: 3
|
||||
})
|
||||
const { code } = generate(root, { mode: 'function' })
|
||||
expect(code).toMatch(
|
||||
@@ -139,10 +140,16 @@ describe('compiler: codegen', () => {
|
||||
}("barbaz")\n`
|
||||
)
|
||||
expect(code).toMatch(
|
||||
`const _directive_my_dir = _${
|
||||
`const _directive_my_dir_0 = _${
|
||||
helperNameMap[RESOLVE_DIRECTIVE]
|
||||
}("my_dir")\n`
|
||||
}("my_dir_0")\n`
|
||||
)
|
||||
expect(code).toMatch(
|
||||
`const _directive_my_dir_1 = _${
|
||||
helperNameMap[RESOLVE_DIRECTIVE]
|
||||
}("my_dir_1")\n`
|
||||
)
|
||||
expect(code).toMatch(`let _temp0, _temp1, _temp2`)
|
||||
expect(code).toMatchSnapshot()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user