diff --git a/packages/docusaurus-plugin-content-blog/src/__tests__/feed.test.ts b/packages/docusaurus-plugin-content-blog/src/__tests__/feed.test.ts index d7747d16300c..367872215282 100644 --- a/packages/docusaurus-plugin-content-blog/src/__tests__/feed.test.ts +++ b/packages/docusaurus-plugin-content-blog/src/__tests__/feed.test.ts @@ -19,6 +19,7 @@ const DefaultI18N: I18n = { currentLocale: 'en', locales: ['en'], defaultLocale: 'en', + path: '1i8n', localeConfigs: { en: { label: 'English', diff --git a/packages/docusaurus-utils/src/__tests__/i18nUtils.test.ts b/packages/docusaurus-utils/src/__tests__/i18nUtils.test.ts index 6e8f4e198a7e..c0b45f358568 100644 --- a/packages/docusaurus-utils/src/__tests__/i18nUtils.test.ts +++ b/packages/docusaurus-utils/src/__tests__/i18nUtils.test.ts @@ -103,6 +103,7 @@ describe('localizePath', () => { path: '/baseUrl', i18n: { defaultLocale: 'en', + path: 'i18n', locales: ['en', 'fr'], currentLocale: 'fr', localeConfigs: {}, @@ -119,6 +120,7 @@ describe('localizePath', () => { path: '/baseFsPath', i18n: { defaultLocale: 'en', + path: 'i18n', locales: ['en', 'fr'], currentLocale: 'fr', localeConfigs: {}, @@ -135,6 +137,7 @@ describe('localizePath', () => { path: '/baseUrl/', i18n: { defaultLocale: 'en', + path: 'i18n', locales: ['en', 'fr'], currentLocale: 'en', localeConfigs: {}, @@ -151,6 +154,7 @@ describe('localizePath', () => { path: '/baseUrl/', i18n: { defaultLocale: 'en', + path: 'i18n', locales: ['en', 'fr'], currentLocale: 'en', localeConfigs: {}, @@ -166,6 +170,7 @@ describe('localizePath', () => { path: '/baseUrl/', i18n: { defaultLocale: 'en', + path: 'i18n', locales: ['en', 'fr'], currentLocale: 'en', localeConfigs: {}, diff --git a/packages/docusaurus/src/server/__tests__/i18n.test.ts b/packages/docusaurus/src/server/__tests__/i18n.test.ts index 8c99d006545c..2f7c5f9059ff 100644 --- a/packages/docusaurus/src/server/__tests__/i18n.test.ts +++ b/packages/docusaurus/src/server/__tests__/i18n.test.ts @@ -8,7 +8,7 @@ import {jest} from '@jest/globals'; import {loadI18n, getDefaultLocaleConfig} from '../i18n'; import {DEFAULT_I18N_CONFIG} from '../configValidation'; -import type {I18nConfig} from '@docusaurus/types'; +import type {DocusaurusConfig, I18nConfig} from '@docusaurus/types'; function testLocaleConfigsFor(locales: string[]) { return Object.fromEntries( @@ -18,10 +18,9 @@ function testLocaleConfigsFor(locales: string[]) { function loadI18nTest(i18nConfig: I18nConfig, locale?: string) { return loadI18n( - // @ts-expect-error: enough for this test { i18n: i18nConfig, - }, + } as DocusaurusConfig, {locale}, ); } @@ -112,6 +111,7 @@ describe('loadI18n', () => { it('loads I18n for multi-lang config', async () => { await expect( loadI18nTest({ + path: 'i18n', defaultLocale: 'fr', locales: ['en', 'fr', 'de'], localeConfigs: {}, @@ -128,6 +128,7 @@ describe('loadI18n', () => { await expect( loadI18nTest( { + path: 'i18n', defaultLocale: 'fr', locales: ['en', 'fr', 'de'], localeConfigs: {}, @@ -146,6 +147,7 @@ describe('loadI18n', () => { await expect( loadI18nTest( { + path: 'i18n', defaultLocale: 'fr', locales: ['en', 'fr', 'de'], localeConfigs: { @@ -175,6 +177,7 @@ describe('loadI18n', () => { it('warns when trying to load undeclared locale', async () => { await loadI18nTest( { + path: 'i18n', defaultLocale: 'fr', locales: ['en', 'fr', 'de'], localeConfigs: {}, diff --git a/packages/docusaurus/src/server/translations/__tests__/translations.test.ts b/packages/docusaurus/src/server/translations/__tests__/translations.test.ts index 7d2ce1cb2811..a62aae849802 100644 --- a/packages/docusaurus/src/server/translations/__tests__/translations.test.ts +++ b/packages/docusaurus/src/server/translations/__tests__/translations.test.ts @@ -281,7 +281,6 @@ describe('writePluginTranslations', () => { await writePluginTranslations({ localizationDir, - locale: 'fr', translationFile: { path: 'my/translation/file', content: { @@ -384,7 +383,6 @@ describe('writePluginTranslations', () => { await expect(() => writePluginTranslations({ localizationDir, - locale: 'fr', translationFile: { path: 'my/translation/file.json', content: {}, @@ -420,7 +418,6 @@ describe('localizePluginTranslationFile', () => { const localizedTranslationFile = await localizePluginTranslationFile({ localizationDir, - locale: 'fr', translationFile, plugin: { name: 'my-plugin-name', @@ -453,7 +450,6 @@ describe('localizePluginTranslationFile', () => { const localizedTranslationFile = await localizePluginTranslationFile({ localizationDir, - locale: 'fr', translationFile, plugin: { name: 'my-plugin-name',