From 74a5a45a3df8791bda2980dd79d3acb80c070cb4 Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Fri, 7 Jul 2023 06:07:38 +1000 Subject: [PATCH] chore: fix some tests --- src/module.ts | 1 - test/i18n.test.ts | 135 +++++++++++++++++++++++----------------------- 2 files changed, 69 insertions(+), 67 deletions(-) diff --git a/src/module.ts b/src/module.ts index 9b9540c..ffbad1c 100644 --- a/src/module.ts +++ b/src/module.ts @@ -243,7 +243,6 @@ export default defineNuxtModule({ // @ts-expect-error runtime types const nuxtI18nConfig = nuxt.options.i18n as Record | undefined if (nuxtI18nConfig?.pages) { - config.inferStaticPagesAsRoutes = false for (const pageLocales of Object.values(nuxtI18nConfig?.pages as Record>)) { for (const locale in pageLocales) { // add root entry for default locale and ignore dynamic routes diff --git a/test/i18n.test.ts b/test/i18n.test.ts index ca2818f..1e886ce 100644 --- a/test/i18n.test.ts +++ b/test/i18n.test.ts @@ -51,75 +51,78 @@ describe('i18n', () => { posts = posts.replace(/.*<\/lastmod>/g, '') expect(posts).toMatchInlineSnapshot(` - " - - - - -

[ - "posts-sitemap.xml" - ]

Made by Harlan Wilton
- " + " + + + https://nuxtseo.com/blog/post-1 + + + https://nuxtseo.com/blog/post-2 + + + https://nuxtseo.com/blog/post-3 + + + https://nuxtseo.com/blog/post-4 + + + https://nuxtseo.com/blog/post-5 + + + " `) expect((await $fetch('/pages-sitemap.xml')).replace(/.*<\/lastmod>/g, '')).toMatchInlineSnapshot(` - " - - - - -

[ - "pages-sitemap.xml" - ]

Made by Harlan Wilton
- " + " + + + https://nuxtseo.com/about + + + + + https://nuxtseo.com/image.jpg + + + https://nuxtseo.com/image2.jpg + + + https://nuxtseo.com/image-3.jpg + + daily + 0.3 + + + https://nuxtseo.com/services + + + + https://nuxtseo.com/users-lazy/1 + + + https://nuxtseo.com/users-lazy/2 + + + https://nuxtseo.com/users-lazy/3 + + + https://nuxtseo.com/services/coaching + + + + https://nuxtseo.com/services/development + + + + https://nuxtseo.com/services/development/app + + + + https://nuxtseo.com/services/development/website + + + + " `) }, 60000) })