Skip to content

Commit 4f6b6e9

Browse files
committed
ensure text is only used as last resort
1 parent 7febe1e commit 4f6b6e9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/html-reporter/src/filter.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class Filter {
165165
if (comparison !== 0)
166166
return sortToken.not ? -comparison : comparison;
167167
}
168-
return 0;
168+
return this._compareTests(a, b, 'file');
169169
});
170170
}
171171

@@ -176,11 +176,9 @@ export class Filter {
176176
return a.title.localeCompare(b.title);
177177
if (field === 'line')
178178
return a.location.line - b.location.line;
179-
const searchValuesA = cacheSearchValues(a);
180-
const searchValuesB = cacheSearchValues(b);
181-
if (field === 'status' || field === 'file' || field === 'project')
182-
return searchValuesA[field].localeCompare(searchValuesB[field]);
183-
return searchValuesA.text.localeCompare(searchValuesB.text);
179+
if (field !== 'status' && field !== 'file' && field !== 'project' && field !== 'text')
180+
return 0;
181+
return cacheSearchValues(a)[field].localeCompare(cacheSearchValues(b)[field]);
184182
}
185183
}
186184

0 commit comments

Comments
 (0)