From 74c96bd2a5d8a8c7f74fec9aa8f97cdde477e5ae Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 4 Jul 2025 14:10:55 +0200 Subject: [PATCH] workaround for test issue related to createMdxLoaderDependencyFile --- packages/docusaurus-plugin-content-docs/src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/docusaurus-plugin-content-docs/src/index.ts b/packages/docusaurus-plugin-content-docs/src/index.ts index d20a88185a..317dadbad0 100644 --- a/packages/docusaurus-plugin-content-docs/src/index.ts +++ b/packages/docusaurus-plugin-content-docs/src/index.ts @@ -62,6 +62,12 @@ async function createMdxLoaderDependencyFile({ options: PluginOptions; versionsMetadata: VersionMetadata[]; }): Promise { + // Disabled for unit tests, the side effect produces infinite watch loops + // TODO find a better way :/ + if (process.env.NODE_ENV === 'test') { + return undefined; + } + const filePath = path.join(dataDir, '__mdx-loader-dependency.json'); // the cache is invalidated whenever this file content changes const fileContent = {