From c9d9b5c4556a21435206cd76503fbe8e26fba6d2 Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 7 Nov 2025 12:49:02 +0100 Subject: [PATCH] try to fix windows issue with fs.realpath.native() call --- packages/docusaurus-utils/src/vcs/__tests__/gitUtils.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-utils/src/vcs/__tests__/gitUtils.test.ts b/packages/docusaurus-utils/src/vcs/__tests__/gitUtils.test.ts index f33bd5e6b6..f85fc06638 100644 --- a/packages/docusaurus-utils/src/vcs/__tests__/gitUtils.test.ts +++ b/packages/docusaurus-utils/src/vcs/__tests__/gitUtils.test.ts @@ -99,7 +99,7 @@ class Git { async function createGitRepoEmpty(): Promise<{repoDir: string; git: Git}> { let repoDir = await fs.mkdtemp(path.join(os.tmpdir(), 'git-test-repo')); - repoDir = await fs.realpath(repoDir); + repoDir = await fs.realpath.native(repoDir); const git = await Git.initializeRepo(repoDir); return {repoDir, git}; } @@ -337,7 +337,7 @@ describe('getGitRepoRoot', () => { it('returns Docusaurus repo for cwd=__dirname', async () => { const cwd = __dirname; - await expect(getGitRepoRoot(cwd)).resolves.toMatch(/\/docusaurus/); + await expect(getGitRepoRoot(cwd)).resolves.toMatch(/docusaurus$/); }); it('rejects for cwd=repoDir/doesNotExist', async () => {