From ca54f5dcdc1d7b92967288153f0fcbcf5dc9e9f4 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sun, 25 May 2025 18:14:24 -0700 Subject: [PATCH] Revert "simplify" This reverts commit 346a349836ee647dc6f63c9bea18fbccde52084a. --- .../src/commands/swizzle/__tests__/index.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts b/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts index 4fb86c366d..013fbab245 100644 --- a/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts +++ b/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts @@ -91,10 +91,15 @@ async function createTestSite() { const siteThemePathPosix = posixPath(siteThemePath); expect(tree(siteThemePathPosix)).toMatchSnapshot('theme dir tree'); - const files = (await Globby(siteThemePathPosix, {absolute: true})).sort(); + const files = (await Globby(siteThemePathPosix)) + .map((file) => path.posix.relative(siteThemePathPosix, file)) + .sort(); for (const file of files) { - const fileContent = await fs.readFile(file, 'utf-8'); + const fileContent = await fs.readFile( + path.posix.join(siteThemePath, file), + 'utf-8', + ); expect(fileContent).toMatchSnapshot(file); } }