Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/markdown-result-groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"e2e": patch
---

The Markdown summary renders faster for files with many results. Output is unchanged.
4 changes: 3 additions & 1 deletion packages/e2e/src/report/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ function fileGroups(entries: readonly Entry[]): FileGroup[] {
const groups = new Map<string, Map<string, Entry[]>>();
for (const entry of entries) {
const byFile = groups.get(entry.result.targetId) ?? new Map<string, Entry[]>();
byFile.set(entry.result.file, [...(byFile.get(entry.result.file) ?? []), entry]);
const grouped = byFile.get(entry.result.file);
if (grouped) grouped.push(entry);
else byFile.set(entry.result.file, [entry]);
groups.set(entry.result.targetId, byFile);
}
const rows = [...groups].flatMap(([target, byFile]) => [...byFile].map(([file, grouped]) => ({ file, target, entries: grouped })));
Expand Down
Loading