From ba18a8b8b9bd396cbc3b1b78ff0164c15f9faa5b Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 26 May 2025 04:29:23 -0700 Subject: [PATCH] chore: simplify construction of test paths (#11196) --- .../docusaurus/src/commands/swizzle/__tests__/index.test.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts b/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts index 013fbab245..a6bc0df605 100644 --- a/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts +++ b/packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts @@ -91,13 +91,11 @@ async function createTestSite() { const siteThemePathPosix = posixPath(siteThemePath); expect(tree(siteThemePathPosix)).toMatchSnapshot('theme dir tree'); - const files = (await Globby(siteThemePathPosix)) - .map((file) => path.posix.relative(siteThemePathPosix, file)) - .sort(); + const files = await Globby('**/*', {cwd: siteThemePath}); for (const file of files) { const fileContent = await fs.readFile( - path.posix.join(siteThemePath, file), + path.join(siteThemePath, file), 'utf-8', ); expect(fileContent).toMatchSnapshot(file);