mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
test(ssr): async components
This commit is contained in:
parent
28d20ec262
commit
bfd8475979
18
test/fixtures/ssr/pages/asyncComponent.vue
vendored
Normal file
18
test/fixtures/ssr/pages/asyncComponent.vue
vendored
Normal 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>
|
@ -62,6 +62,10 @@ test('unique responses with component', async t => {
|
|||||||
await uniqueTest(t, '/component')
|
await uniqueTest(t, '/component')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('unique responses with async components', async t => {
|
||||||
|
await uniqueTest(t, '/asyncComponent')
|
||||||
|
})
|
||||||
|
|
||||||
test('unique responses with asyncData()', async t => {
|
test('unique responses with asyncData()', async t => {
|
||||||
await uniqueTest(t, '/asyncData')
|
await uniqueTest(t, '/asyncData')
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user