chore: simplify construction of test paths (#11196)

This commit is contained in:
Ben McCann 2025-05-26 04:29:23 -07:00 committed by GitHub
parent 5d858f5e66
commit ba18a8b8b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);