From b5f48dd48a4846f1726f86e06d4c78ebce48fcc7 Mon Sep 17 00:00:00 2001 From: Bobbie Goede Date: Mon, 3 Feb 2025 17:42:39 +0100 Subject: [PATCH] test: remove logs and add `baseUrl` config (#3342) --- specs/basic_usage.spec.ts | 8 ++++---- specs/basic_usage_compat_4.spec.ts | 8 ++++---- .../prefix_except_default.spec.ts | 2 +- specs/custom_route_paths/component.spec.ts | 3 +-- specs/custom_route_paths/module_configration.spec.ts | 4 ++-- specs/experimental/scan_page_meta.spec.ts | 2 +- .../experimental/switch_locale_path_link_ssr.spec.ts | 2 +- specs/fixtures/basic_usage/nuxt.config.ts | 1 + specs/fixtures/basic_usage_compat_4/localeDetector.ts | 1 - specs/fixtures/basic_usage_compat_4/nuxt.config.ts | 1 + specs/fixtures/issues/2590/app.vue | 2 -- specs/fixtures/routing/nuxt.config.ts | 1 + specs/lazy_load/basic_lazy_load.spec.ts | 7 +------ specs/lazy_load/restructure.spec.ts | 7 +------ specs/routing/composition.spec.ts | 11 +---------- specs/routing/legacy.spec.ts | 11 +---------- specs/routing_strategies/no_prefix.spec.ts | 2 +- specs/routing_strategies/prefix.spec.ts | 2 +- specs/routing_strategies/root_redirect.spec.ts | 2 +- specs/seo/baseUrl.spec.ts | 1 - specs/ssg/basic_lazy_load.spec.ts | 9 +-------- 21 files changed, 25 insertions(+), 62 deletions(-) diff --git a/specs/basic_usage.spec.ts b/specs/basic_usage.spec.ts index 18f0035fc..119a38f70 100644 --- a/specs/basic_usage.spec.ts +++ b/specs/basic_usage.spec.ts @@ -26,7 +26,7 @@ describe('basic usage', async () => { runtimeConfig: { public: { i18n: { - baseUrl: '', + baseUrl: 'http://localhost:3000', skipSettingLocaleOnNavigate: undefined, detectBrowserLanguage: undefined } @@ -139,7 +139,7 @@ describe('basic usage', async () => { ) expect(await getText(page, '#locale-head')).toMatchInlineSnapshot( - `"{ "htmlAttrs": { "lang": "en" }, "link": [ { "hid": "i18n-alt-en", "rel": "alternate", "href": "/nuxt-context-extension", "hreflang": "en" }, { "hid": "i18n-alt-fr", "rel": "alternate", "href": "/fr/nuxt-context-extension", "hreflang": "fr" }, { "hid": "i18n-alt-ja", "rel": "alternate", "href": "/ja/nuxt-context-extension", "hreflang": "ja" }, { "hid": "i18n-alt-ja-JP", "rel": "alternate", "href": "/ja/nuxt-context-extension", "hreflang": "ja-JP" }, { "hid": "i18n-alt-nl", "rel": "alternate", "href": "/nl/nuxt-context-extension", "hreflang": "nl" }, { "hid": "i18n-alt-nl-NL", "rel": "alternate", "href": "/nl/nuxt-context-extension", "hreflang": "nl-NL" }, { "hid": "i18n-alt-kr", "rel": "alternate", "href": "/kr/nuxt-context-extension", "hreflang": "kr" }, { "hid": "i18n-alt-kr-KO", "rel": "alternate", "href": "/kr/nuxt-context-extension", "hreflang": "kr-KO" }, { "hid": "i18n-xd", "rel": "alternate", "href": "/nuxt-context-extension", "hreflang": "x-default" }, { "hid": "i18n-can", "rel": "canonical", "href": "/nuxt-context-extension" } ], "meta": [ { "hid": "i18n-og-url", "property": "og:url", "content": "/nuxt-context-extension" }, { "hid": "i18n-og", "property": "og:locale", "content": "en" }, { "hid": "i18n-og-alt-fr", "property": "og:locale:alternate", "content": "fr" }, { "hid": "i18n-og-alt-ja-JP", "property": "og:locale:alternate", "content": "ja_JP" }, { "hid": "i18n-og-alt-nl-NL", "property": "og:locale:alternate", "content": "nl_NL" }, { "hid": "i18n-og-alt-kr-KO", "property": "og:locale:alternate", "content": "kr_KO" } ] }"` + `"{ "htmlAttrs": { "lang": "en" }, "link": [ { "hid": "i18n-alt-en", "rel": "alternate", "href": "http://localhost:3000/nuxt-context-extension", "hreflang": "en" }, { "hid": "i18n-alt-fr", "rel": "alternate", "href": "http://localhost:3000/fr/nuxt-context-extension", "hreflang": "fr" }, { "hid": "i18n-alt-ja", "rel": "alternate", "href": "http://localhost:3000/ja/nuxt-context-extension", "hreflang": "ja" }, { "hid": "i18n-alt-ja-JP", "rel": "alternate", "href": "http://localhost:3000/ja/nuxt-context-extension", "hreflang": "ja-JP" }, { "hid": "i18n-alt-nl", "rel": "alternate", "href": "http://localhost:3000/nl/nuxt-context-extension", "hreflang": "nl" }, { "hid": "i18n-alt-nl-NL", "rel": "alternate", "href": "http://localhost:3000/nl/nuxt-context-extension", "hreflang": "nl-NL" }, { "hid": "i18n-alt-kr", "rel": "alternate", "href": "http://localhost:3000/kr/nuxt-context-extension", "hreflang": "kr" }, { "hid": "i18n-alt-kr-KO", "rel": "alternate", "href": "http://localhost:3000/kr/nuxt-context-extension", "hreflang": "kr-KO" }, { "hid": "i18n-xd", "rel": "alternate", "href": "http://localhost:3000/nuxt-context-extension", "hreflang": "x-default" }, { "hid": "i18n-can", "rel": "canonical", "href": "http://localhost:3000/nuxt-context-extension" } ], "meta": [ { "hid": "i18n-og-url", "property": "og:url", "content": "http://localhost:3000/nuxt-context-extension" }, { "hid": "i18n-og", "property": "og:locale", "content": "en" }, { "hid": "i18n-og-alt-fr", "property": "og:locale:alternate", "content": "fr" }, { "hid": "i18n-og-alt-ja-JP", "property": "og:locale:alternate", "content": "ja_JP" }, { "hid": "i18n-og-alt-nl-NL", "property": "og:locale:alternate", "content": "nl_NL" }, { "hid": "i18n-og-alt-kr-KO", "property": "og:locale:alternate", "content": "kr_KO" } ] }"` ) }) @@ -463,11 +463,11 @@ describe('basic usage', async () => { // head tags - alt links are updated server side const product1Html = await $fetch('/products/big-chair') const product1Dom = getDom(product1Html) - expect(product1Dom.querySelector('#i18n-alt-nl').href).toEqual('/nl/products/grote-stoel') + expect(product1Dom.querySelector('#i18n-alt-nl').href).toEqual('http://localhost:3000/nl/products/grote-stoel') const product2Html = await $fetch('/nl/products/rode-mok') const product2dom = getDom(product2Html) - expect(product2dom.querySelector('#i18n-alt-en').href).toEqual('/products/red-mug') + expect(product2dom.querySelector('#i18n-alt-en').href).toEqual('http://localhost:3000/products/red-mug') }) describe('language switching', async () => { diff --git a/specs/basic_usage_compat_4.spec.ts b/specs/basic_usage_compat_4.spec.ts index 8494722de..55b34c74c 100644 --- a/specs/basic_usage_compat_4.spec.ts +++ b/specs/basic_usage_compat_4.spec.ts @@ -26,7 +26,7 @@ describe('basic usage - compatibilityVersion: 4', async () => { runtimeConfig: { public: { i18n: { - baseUrl: '', + baseUrl: 'http://localhost:3000', skipSettingLocaleOnNavigate: undefined, detectBrowserLanguage: undefined } @@ -139,7 +139,7 @@ describe('basic usage - compatibilityVersion: 4', async () => { ) expect(await getText(page, '#locale-head')).toMatchInlineSnapshot( - `"{ "htmlAttrs": { "lang": "en" }, "link": [ { "hid": "i18n-alt-en", "rel": "alternate", "href": "/nuxt-context-extension", "hreflang": "en" }, { "hid": "i18n-alt-ja", "rel": "alternate", "href": "/ja/nuxt-context-extension", "hreflang": "ja" }, { "hid": "i18n-alt-ja-JP", "rel": "alternate", "href": "/ja/nuxt-context-extension", "hreflang": "ja-JP" }, { "hid": "i18n-alt-fr", "rel": "alternate", "href": "/fr/nuxt-context-extension", "hreflang": "fr" }, { "hid": "i18n-alt-fr-FR", "rel": "alternate", "href": "/fr/nuxt-context-extension", "hreflang": "fr-FR" }, { "hid": "i18n-alt-nl", "rel": "alternate", "href": "/nl/nuxt-context-extension", "hreflang": "nl" }, { "hid": "i18n-alt-nl-NL", "rel": "alternate", "href": "/nl/nuxt-context-extension", "hreflang": "nl-NL" }, { "hid": "i18n-alt-kr", "rel": "alternate", "href": "/kr/nuxt-context-extension", "hreflang": "kr" }, { "hid": "i18n-alt-kr-KO", "rel": "alternate", "href": "/kr/nuxt-context-extension", "hreflang": "kr-KO" }, { "hid": "i18n-xd", "rel": "alternate", "href": "/nuxt-context-extension", "hreflang": "x-default" }, { "hid": "i18n-can", "rel": "canonical", "href": "/nuxt-context-extension" } ], "meta": [ { "hid": "i18n-og-url", "property": "og:url", "content": "/nuxt-context-extension" }, { "hid": "i18n-og", "property": "og:locale", "content": "en" }, { "hid": "i18n-og-alt-ja-JP", "property": "og:locale:alternate", "content": "ja_JP" }, { "hid": "i18n-og-alt-fr-FR", "property": "og:locale:alternate", "content": "fr_FR" }, { "hid": "i18n-og-alt-nl-NL", "property": "og:locale:alternate", "content": "nl_NL" }, { "hid": "i18n-og-alt-kr-KO", "property": "og:locale:alternate", "content": "kr_KO" } ] }"` + `"{ "htmlAttrs": { "lang": "en" }, "link": [ { "hid": "i18n-alt-en", "rel": "alternate", "href": "http://localhost:3000/nuxt-context-extension", "hreflang": "en" }, { "hid": "i18n-alt-ja", "rel": "alternate", "href": "http://localhost:3000/ja/nuxt-context-extension", "hreflang": "ja" }, { "hid": "i18n-alt-ja-JP", "rel": "alternate", "href": "http://localhost:3000/ja/nuxt-context-extension", "hreflang": "ja-JP" }, { "hid": "i18n-alt-fr", "rel": "alternate", "href": "http://localhost:3000/fr/nuxt-context-extension", "hreflang": "fr" }, { "hid": "i18n-alt-fr-FR", "rel": "alternate", "href": "http://localhost:3000/fr/nuxt-context-extension", "hreflang": "fr-FR" }, { "hid": "i18n-alt-nl", "rel": "alternate", "href": "http://localhost:3000/nl/nuxt-context-extension", "hreflang": "nl" }, { "hid": "i18n-alt-nl-NL", "rel": "alternate", "href": "http://localhost:3000/nl/nuxt-context-extension", "hreflang": "nl-NL" }, { "hid": "i18n-alt-kr", "rel": "alternate", "href": "http://localhost:3000/kr/nuxt-context-extension", "hreflang": "kr" }, { "hid": "i18n-alt-kr-KO", "rel": "alternate", "href": "http://localhost:3000/kr/nuxt-context-extension", "hreflang": "kr-KO" }, { "hid": "i18n-xd", "rel": "alternate", "href": "http://localhost:3000/nuxt-context-extension", "hreflang": "x-default" }, { "hid": "i18n-can", "rel": "canonical", "href": "http://localhost:3000/nuxt-context-extension" } ], "meta": [ { "hid": "i18n-og-url", "property": "og:url", "content": "http://localhost:3000/nuxt-context-extension" }, { "hid": "i18n-og", "property": "og:locale", "content": "en" }, { "hid": "i18n-og-alt-ja-JP", "property": "og:locale:alternate", "content": "ja_JP" }, { "hid": "i18n-og-alt-fr-FR", "property": "og:locale:alternate", "content": "fr_FR" }, { "hid": "i18n-og-alt-nl-NL", "property": "og:locale:alternate", "content": "nl_NL" }, { "hid": "i18n-og-alt-kr-KO", "property": "og:locale:alternate", "content": "kr_KO" } ] }"` ) }) @@ -463,11 +463,11 @@ describe('basic usage - compatibilityVersion: 4', async () => { // head tags - alt links are updated server side const product1Html = await $fetch('/products/big-chair') const product1Dom = getDom(product1Html) - expect(product1Dom.querySelector('#i18n-alt-nl').href).toEqual('/nl/products/grote-stoel') + expect(product1Dom.querySelector('#i18n-alt-nl').href).toEqual('http://localhost:3000/nl/products/grote-stoel') const product2Html = await $fetch('/nl/products/rode-mok') const product2dom = getDom(product2Html) - expect(product2dom.querySelector('#i18n-alt-en').href).toEqual('/products/red-mug') + expect(product2dom.querySelector('#i18n-alt-en').href).toEqual('http://localhost:3000/products/red-mug') }) describe('language switching', async () => { diff --git a/specs/browser_language_detection/prefix_except_default.spec.ts b/specs/browser_language_detection/prefix_except_default.spec.ts index dead1dd5a..2fc03bd04 100644 --- a/specs/browser_language_detection/prefix_except_default.spec.ts +++ b/specs/browser_language_detection/prefix_except_default.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from 'vitest' +import { test, expect, describe, beforeEach } from 'vitest' import { fileURLToPath } from 'node:url' import { setup, url } from '../utils' import { getText, renderPage, startServerWithRuntimeConfig } from '../helper' diff --git a/specs/custom_route_paths/component.spec.ts b/specs/custom_route_paths/component.spec.ts index cf37724bd..ae1dcc566 100644 --- a/specs/custom_route_paths/component.spec.ts +++ b/specs/custom_route_paths/component.spec.ts @@ -75,7 +75,7 @@ test('can not access to disable route path', async () => { expect(await page.locator('#link-ignore-disable').getAttribute('href')).toBe(null) // disable direct url access - let res: Response | (Error & { status: () => number }) | null = null + let res: Awaited> | (Error & { status: () => number }) | null = null try { // attempting to goto /fr/disable instead of /fr/ignore-routes/disable since // that route has a catch all that would succeed @@ -84,7 +84,6 @@ test('can not access to disable route path', async () => { res = error as Error & { status: () => number } } - console.log(res) // 404 expect(res!.status()).toBe(404) // eslint-disable-line @typescript-eslint/no-non-null-assertion }) diff --git a/specs/custom_route_paths/module_configration.spec.ts b/specs/custom_route_paths/module_configration.spec.ts index 9e9b362ce..7ea003059 100644 --- a/specs/custom_route_paths/module_configration.spec.ts +++ b/specs/custom_route_paths/module_configration.spec.ts @@ -77,7 +77,7 @@ test('can not access to pick route path', async () => { expect(await page.locator('#link-history').getAttribute('href')).toBe(null) // disable direct url access - let res: Response | (Error & { status: () => number }) | null = null + let res: Awaited> | (Error & { status: () => number }) | null = null try { res = await page.goto(url('/fr/history')) } catch (error: unknown) { @@ -98,7 +98,7 @@ test('can not access to disable route path', async () => { expect(await page.locator('#link-category').getAttribute('href')).toBe(null) // disable direct url access - let res: Response | (Error & { status: () => number }) | null = null + let res: Awaited> | (Error & { status: () => number }) | null = null try { res = await page.goto(url('/fr/category/test')) } catch (error: unknown) { diff --git a/specs/experimental/scan_page_meta.spec.ts b/specs/experimental/scan_page_meta.spec.ts index c3fe8c36e..6b622ab61 100644 --- a/specs/experimental/scan_page_meta.spec.ts +++ b/specs/experimental/scan_page_meta.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from 'vitest' +import { test, expect, describe } from 'vitest' import { fileURLToPath } from 'node:url' import { setup, url } from '../utils' import { getText, renderPage } from '../helper' diff --git a/specs/experimental/switch_locale_path_link_ssr.spec.ts b/specs/experimental/switch_locale_path_link_ssr.spec.ts index 881c315b2..adc1d8a57 100644 --- a/specs/experimental/switch_locale_path_link_ssr.spec.ts +++ b/specs/experimental/switch_locale_path_link_ssr.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from 'vitest' +import { test, expect, describe } from 'vitest' import { fileURLToPath } from 'node:url' import { $fetch, setup } from '../utils' import { getDom, gotoPath, renderPage, waitForURL } from '../helper' diff --git a/specs/fixtures/basic_usage/nuxt.config.ts b/specs/fixtures/basic_usage/nuxt.config.ts index 8d7419817..b641a53e1 100644 --- a/specs/fixtures/basic_usage/nuxt.config.ts +++ b/specs/fixtures/basic_usage/nuxt.config.ts @@ -17,6 +17,7 @@ export default defineNuxtConfig({ plugins: [`../plugins/i18nHooks.ts`], i18n: { restructureDir: false, + baseUrl: 'http://localhost:3000', vueI18n: './config/i18n.config.ts', locales: ['en', 'fr'], defaultLocale: 'en', diff --git a/specs/fixtures/basic_usage_compat_4/localeDetector.ts b/specs/fixtures/basic_usage_compat_4/localeDetector.ts index ca4942678..691a6c11b 100644 --- a/specs/fixtures/basic_usage_compat_4/localeDetector.ts +++ b/specs/fixtures/basic_usage_compat_4/localeDetector.ts @@ -1,6 +1,5 @@ // Detect based on query, cookie, header export default defineI18nLocaleDetector((event, { defaultLocale }) => { - console.log('hello') const query = tryQueryLocale(event, { lang: '' }) if (query) { return query.toString() diff --git a/specs/fixtures/basic_usage_compat_4/nuxt.config.ts b/specs/fixtures/basic_usage_compat_4/nuxt.config.ts index 13487a531..7c48a5b1b 100644 --- a/specs/fixtures/basic_usage_compat_4/nuxt.config.ts +++ b/specs/fixtures/basic_usage_compat_4/nuxt.config.ts @@ -19,6 +19,7 @@ export default defineNuxtConfig({ plugins: [`../plugins/i18nHooks.ts`], i18n: { restructureDir: false, + baseUrl: 'http://localhost:3000', vueI18n: './config/i18n.config.ts', defaultLocale: 'en', experimental: { diff --git a/specs/fixtures/issues/2590/app.vue b/specs/fixtures/issues/2590/app.vue index 14db24202..ece28fc70 100644 --- a/specs/fixtures/issues/2590/app.vue +++ b/specs/fixtures/issues/2590/app.vue @@ -13,8 +13,6 @@ useHead(() => ({ htmlAttrs: head.value.htmlAttrs })) -console.log(head.value.htmlAttrs) - const availableLocales = computed(() => { return (locales.value as LocaleObject[]) .filter(item => { diff --git a/specs/fixtures/routing/nuxt.config.ts b/specs/fixtures/routing/nuxt.config.ts index e29bbeb5b..df5332c1b 100644 --- a/specs/fixtures/routing/nuxt.config.ts +++ b/specs/fixtures/routing/nuxt.config.ts @@ -3,6 +3,7 @@ export default defineNuxtConfig({ modules: ['@nuxtjs/i18n'], i18n: { + baseUrl: 'http://localhost:3000', restructureDir: false, locales: ['en', 'ja'], detectBrowserLanguage: false diff --git a/specs/lazy_load/basic_lazy_load.spec.ts b/specs/lazy_load/basic_lazy_load.spec.ts index 48f558a45..4cb5d1baf 100644 --- a/specs/lazy_load/basic_lazy_load.spec.ts +++ b/specs/lazy_load/basic_lazy_load.spec.ts @@ -17,10 +17,6 @@ describe('basic lazy loading', async () => { test('dynamic locale files are not cached', async () => { const { page } = await renderPage('/nl') - page.on('domcontentloaded', () => { - console.log('domcontentload triggered!') - }) - // capture dynamicTime - simulates changing api response const dynamicTime = await getText(page, '#dynamic-time') @@ -45,7 +41,6 @@ describe('basic lazy loading', async () => { // only default locales are fetched (en) await page.goto(home) - console.log(setFromRequests()) expect(setFromRequests().filter(locale => locale.includes('fr') || locale.includes('nl'))).toHaveLength(0) // wait for request after navigation @@ -107,7 +102,7 @@ describe('basic lazy loading', async () => { expect(await page.getAttribute('html', 'lang')).toEqual('fr-FR') }) - test('mutiple lazy loading', async () => { + test('multiple lazy loading', async () => { const { page } = await renderPage('/en-GB') // `en` base rendering diff --git a/specs/lazy_load/restructure.spec.ts b/specs/lazy_load/restructure.spec.ts index ceda20f58..52ad7e19a 100644 --- a/specs/lazy_load/restructure.spec.ts +++ b/specs/lazy_load/restructure.spec.ts @@ -17,10 +17,6 @@ describe('basic lazy loading (restructure)', async () => { test('dynamic locale files are not cached', async () => { const { page } = await renderPage('/nl') - page.on('domcontentloaded', () => { - console.log('domcontentload triggered!') - }) - // capture dynamicTime - simulates changing api response const dynamicTime = await getText(page, '#dynamic-time') @@ -45,7 +41,6 @@ describe('basic lazy loading (restructure)', async () => { // only default locales are fetched (en) await page.goto(home) - console.log(setFromRequests()) expect(setFromRequests().filter(locale => locale.includes('fr') || locale.includes('nl'))).toHaveLength(0) // wait for request after navigation @@ -107,7 +102,7 @@ describe('basic lazy loading (restructure)', async () => { expect(await page.getAttribute('html', 'lang')).toEqual('fr-FR') }) - test('mutiple lazy loading', async () => { + test('multiple lazy loading', async () => { const { page } = await renderPage('/en-GB') // `en` base rendering diff --git a/specs/routing/composition.spec.ts b/specs/routing/composition.spec.ts index 275e0ed41..71aff9616 100644 --- a/specs/routing/composition.spec.ts +++ b/specs/routing/composition.spec.ts @@ -11,16 +11,7 @@ await setup({ nuxtConfig: { i18n: { customRoutes: 'config', - pages: { - // 'categories/[id]': { - // en: 'categories/english', - // ja: 'categories/japanese' - // } - // '[...pathMatch]': { - // en: { pathMatch: 'not-found-english' }, - // ja: { pathMatch: 'not-found-japanese' } - // } - } + pages: {} } } }) diff --git a/specs/routing/legacy.spec.ts b/specs/routing/legacy.spec.ts index 388cf45e8..444a6ebc8 100644 --- a/specs/routing/legacy.spec.ts +++ b/specs/routing/legacy.spec.ts @@ -12,16 +12,7 @@ await setup({ i18n: { vueI18n: 'i18n-legacy.config.ts', customRoutes: 'config', - pages: { - // 'categories/[id]': { - // en: 'categories/english', - // ja: 'categories/japanese' - // } - // '[...pathMatch]': { - // en: { pathMatch: 'not-found-english' }, - // ja: { pathMatch: 'not-found-japanese' } - // } - } + pages: {} } } }) diff --git a/specs/routing_strategies/no_prefix.spec.ts b/specs/routing_strategies/no_prefix.spec.ts index d5ce9f004..784e3c510 100644 --- a/specs/routing_strategies/no_prefix.spec.ts +++ b/specs/routing_strategies/no_prefix.spec.ts @@ -1,4 +1,4 @@ -import { describe, test, expect } from 'vitest' +import { describe, test, expect, beforeAll } from 'vitest' import { fileURLToPath } from 'node:url' import { setup, url } from '../utils' import { diff --git a/specs/routing_strategies/prefix.spec.ts b/specs/routing_strategies/prefix.spec.ts index cb22b7732..270140286 100644 --- a/specs/routing_strategies/prefix.spec.ts +++ b/specs/routing_strategies/prefix.spec.ts @@ -1,4 +1,4 @@ -import { describe, test, expect } from 'vitest' +import { describe, test, expect, beforeEach } from 'vitest' import { fileURLToPath } from 'node:url' import { setup, url, fetch } from '../utils' import { getText, getData, renderPage, waitForURL, startServerWithRuntimeConfig, gotoPath } from '../helper' diff --git a/specs/routing_strategies/root_redirect.spec.ts b/specs/routing_strategies/root_redirect.spec.ts index 39bc1e0c2..daccad68c 100644 --- a/specs/routing_strategies/root_redirect.spec.ts +++ b/specs/routing_strategies/root_redirect.spec.ts @@ -1,4 +1,4 @@ -import { test, expect } from 'vitest' +import { test, expect, describe } from 'vitest' import { fileURLToPath } from 'node:url' import { setup, url, fetch } from '../utils' import { startServerWithRuntimeConfig } from '../helper' diff --git a/specs/seo/baseUrl.spec.ts b/specs/seo/baseUrl.spec.ts index 5b61e81f2..0f815d92c 100644 --- a/specs/seo/baseUrl.spec.ts +++ b/specs/seo/baseUrl.spec.ts @@ -14,7 +14,6 @@ await setup({ // @ts-ignore const headers = useRequestHeaders(['x-override-base-url']) const xOverrideBaseUrl = headers['x-override-base-url'] - console.log('xOverrideBaseUrl', xOverrideBaseUrl) if (Array.isArray(xOverrideBaseUrl)) { return xOverrideBaseUrl[0] } diff --git a/specs/ssg/basic_lazy_load.spec.ts b/specs/ssg/basic_lazy_load.spec.ts index cca02ad27..8d6d100b6 100644 --- a/specs/ssg/basic_lazy_load.spec.ts +++ b/specs/ssg/basic_lazy_load.spec.ts @@ -18,10 +18,6 @@ describe('basic lazy loading', async () => { test('dynamic locale files are not cached', async () => { const { page } = await renderPage('/nl') - page.on('domcontentloaded', () => { - console.log('domcontentload triggered!') - }) - // capture dynamicTime - simulates changing api response const dynamicTime = await getText(page, '#dynamic-time') @@ -46,7 +42,6 @@ describe('basic lazy loading', async () => { // only default locales are fetched (en) await page.goto(home) - console.log(setFromRequests()) expect(setFromRequests().filter(locale => locale.includes('fr') || locale.includes('nl'))).toHaveLength(0) // wait for request after navigation @@ -90,8 +85,6 @@ describe('basic lazy loading', async () => { test('can access to prefix locale: /fr', async () => { const { page } = await renderPage('/fr') - console.log(page.url()) - // `fr` rendering expect(await getText(page, '#home-header')).toEqual('Accueil') expect(await getText(page, 'title')).toEqual('Accueil') @@ -110,7 +103,7 @@ describe('basic lazy loading', async () => { expect(await page.getAttribute('html', 'lang')).toEqual('fr-FR') }) - test('mutiple lazy loading', async () => { + test('multiple lazy loading', async () => { const { page } = await renderPage('/en-GB') // `en` base rendering