Skip to content

Commit 346a349

Browse files
committed
simplify
1 parent 175cfbf commit 346a349

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,10 @@ 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(siteThemePathPosix, {absolute: true})).sort();
9795

9896
for (const file of files) {
99-
const fileContent = await fs.readFile(
100-
path.posix.join(siteThemePath, file),
101-
'utf-8',
102-
);
97+
const fileContent = await fs.readFile(file, 'utf-8');
10398
expect(fileContent).toMatchSnapshot(file);
10499
}
105100
}

0 commit comments

Comments
 (0)