test(ssr): async components

This commit is contained in:
Pooya Parsa 2017-07-03 22:59:38 +04:30
parent 28d20ec262
commit bfd8475979
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<template>
<div>
<async-test/>
</div>
</template>
<script>
export default {
async asyncData({ error }) {
try {
this.components.AsyncTest = await import(`@/components/test.vue`)
} catch (e) {
error({ statusCode: 404, message: 'Can not load test component' })
}
}
}
</script>

View File

@ -62,6 +62,10 @@ test('unique responses with component', async t => {
await uniqueTest(t, '/component')
})
test('unique responses with async components', async t => {
await uniqueTest(t, '/asyncComponent')
})
test('unique responses with asyncData()', async t => {
await uniqueTest(t, '/asyncData')
})