mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 21:32:38 +02:00
chore: simplify construction of test paths (#11196)
This commit is contained in:
parent
5d858f5e66
commit
ba18a8b8b9
1 changed files with 2 additions and 4 deletions
|
@ -91,13 +91,11 @@ async function createTestSite() {
|
||||||
const siteThemePathPosix = posixPath(siteThemePath);
|
const siteThemePathPosix = posixPath(siteThemePath);
|
||||||
expect(tree(siteThemePathPosix)).toMatchSnapshot('theme dir tree');
|
expect(tree(siteThemePathPosix)).toMatchSnapshot('theme dir tree');
|
||||||
|
|
||||||
const files = (await Globby(siteThemePathPosix))
|
const files = await Globby('**/*', {cwd: siteThemePath});
|
||||||
.map((file) => path.posix.relative(siteThemePathPosix, file))
|
|
||||||
.sort();
|
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const fileContent = await fs.readFile(
|
const fileContent = await fs.readFile(
|
||||||
path.posix.join(siteThemePath, file),
|
path.join(siteThemePath, file),
|
||||||
'utf-8',
|
'utf-8',
|
||||||
);
|
);
|
||||||
expect(fileContent).toMatchSnapshot(file);
|
expect(fileContent).toMatchSnapshot(file);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue