Skip to content

Commit ba18a8b

Browse files
authored
chore: simplify construction of test paths (#11196)
1 parent 5d858f5 commit ba18a8b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/docusaurus/src/commands/swizzle/__tests__/index.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,11 @@ async function createTestSite() {
9191
const siteThemePathPosix = posixPath(siteThemePath);
9292
expect(tree(siteThemePathPosix)).toMatchSnapshot('theme dir tree');
9393

94-
const files = (await Globby(siteThemePathPosix))
95-
.map((file) => path.posix.relative(siteThemePathPosix, file))
96-
.sort();
94+
const files = await Globby('**/*', {cwd: siteThemePath});
9795

9896
for (const file of files) {
9997
const fileContent = await fs.readFile(
100-
path.posix.join(siteThemePath, file),
98+
path.join(siteThemePath, file),
10199
'utf-8',
102100
);
103101
expect(fileContent).toMatchSnapshot(file);

0 commit comments

Comments
 (0)