From 671c56b6691d16df786e715e3dbc876c65b2c6ec Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 9 Oct 2024 17:15:41 +0200 Subject: [PATCH] test: update fixture --- test/fixtures/basic/modules/page-extend/index.ts | 9 +++++++-- test/fixtures/basic/nuxt.config.ts | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/fixtures/basic/modules/page-extend/index.ts b/test/fixtures/basic/modules/page-extend/index.ts index 60ef2c224c..a72c5a791a 100644 --- a/test/fixtures/basic/modules/page-extend/index.ts +++ b/test/fixtures/basic/modules/page-extend/index.ts @@ -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: { diff --git a/test/fixtures/basic/nuxt.config.ts b/test/fixtures/basic/nuxt.config.ts index 3e41835bf2..b2030ab163 100644 --- a/test/fixtures/basic/nuxt.config.ts +++ b/test/fixtures/basic/nuxt.config.ts @@ -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') }