Skip to content

Commit 5ef7470

Browse files
committed
simplify
1 parent 5a1b7dc commit 5ef7470

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

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

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

94-
const globFiles = await Globby(siteThemePathPosix);
95-
const files = globFiles
96-
.map((file) => path.posix.relative(siteThemePathPosix, file))
97-
.sort();
98-
console.log({
99-
siteThemePath,
100-
siteThemePathPosix,
101-
globFiles,
102-
files,
103-
});
94+
const files = (await Globby(siteThemePathPosix, {absolute: true})).sort();
10495

10596
for (const file of files) {
106-
const fileContent = await fs.readFile(
107-
path.posix.join(siteThemePath, file),
108-
'utf-8',
109-
);
97+
const fileContent = await fs.readFile(file, 'utf-8');
11098
expect(fileContent).toMatchSnapshot(file);
11199
}
112100
}

0 commit comments

Comments
 (0)