test: harden wsl2 fixtures

This commit is contained in:
Peter Steinberger
2026-05-17 13:45:17 +01:00
parent c80cb5986f
commit e43a2efcdb
10 changed files with 77 additions and 39 deletions

View File

@@ -33,7 +33,11 @@ function isProductionCodeFile(relativePath: string): boolean {
}
function listGitCodeFiles(root: string): string[] | null {
return listGitTrackedFiles({ repoRoot, pathspecs: root })?.filter(isProductionCodeFile) ?? null;
return (
listGitTrackedFiles({ repoRoot, pathspecs: root })
?.filter(isProductionCodeFile)
.filter((relativePath) => fs.existsSync(path.join(repoRoot, relativePath))) ?? null
);
}
function walkCodeFiles(dir: string, files: string[] = []): string[] {