test: update fixture

This commit is contained in:
Daniel Roe 2024-10-09 17:15:41 +02:00
parent faedfdffd9
commit 671c56b669
No known key found for this signature in database
GPG Key ID: CBC814C393D93268
2 changed files with 9 additions and 4 deletions

View File

@ -13,13 +13,18 @@ export default defineNuxtModule({
name: 'page-extend',
path: '/page-extend',
file: resolver.resolve('../runtime/page.vue'),
}, {
})
})
nuxt.hook('pages:resolved', (pages) => {
pages.push({
path: '/big-page-1',
file: resolver.resolve('./pages/big-page.vue'),
meta: {
layout: false,
},
}, {
},
{
path: '/big-page-2',
file: resolver.resolve('./pages/big-page.vue'),
meta: {

View File

@ -149,7 +149,7 @@ export default defineNuxtConfig({
_layout: page.meta?.layout,
},
})
nuxt.hook('pages:extend', (pages) => {
nuxt.hook('pages:resolved', (pages) => {
const newPages = []
for (const page of pages) {
if (routesToDuplicate.includes(page.path)) {
@ -162,7 +162,7 @@ export default defineNuxtConfig({
},
function (_options, nuxt) {
// to check that page metadata is preserved
nuxt.hook('pages:extend', (pages) => {
nuxt.hook('pages:resolved', (pages) => {
const customName = pages.find(page => page.name === 'some-custom-name')
if (!customName) { throw new Error('Page with custom name not found') }
if (customName.path !== '/some-custom-path') { throw new Error('Page path not extracted') }