wip: compat test coverage

This commit is contained in:
Evan You
2021-04-30 18:05:03 -04:00
parent 324a00c85d
commit 80303bcf5a
4 changed files with 93 additions and 9 deletions

View File

@@ -59,4 +59,24 @@ describe('COMPONENT_ASYNC', () => {
)
).toHaveBeenWarned()
})
test('object syntax', async () => {
const comp = () => ({
component: Promise.resolve({ template: 'foo' })
})
const vm = new Vue({
template: `<div><comp/></div>`,
components: { comp }
}).$mount()
expect(vm.$el.innerHTML).toBe(`<!---->`)
await timeout(0)
expect(vm.$el.innerHTML).toBe(`foo`)
expect(
(deprecationData[DeprecationTypes.COMPONENT_ASYNC].message as Function)(
comp
)
).toHaveBeenWarned()
})
})