Skip to content

Commit de903bd

Browse files
KaiDoeringalekseykulikov
authored andcommitted
Filter for failed assertion results
1 parent 1b0e7c3 commit de903bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils/annotations.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ Expected <= 0, but found 1
2424
export async function setAnnotations(resultsPath) {
2525
const links = await getLinks(resultsPath)
2626
const assertionResults = await getAssertionResults(resultsPath)
27-
if (!assertionResults) return
27+
const failedAssertions = assertionResults?.filter((a) => !a.passed)
28+
if (!failedAssertions) return
2829

29-
const assertionResultsByUrl = mapValues(groupBy(assertionResults, 'url'), (assertions) => {
30+
const assertionResultsByUrl = mapValues(groupBy(failedAssertions, 'url'), (assertions) => {
3031
return orderBy(assertions, (a) => (a.level === 'error' ? 0 : 1) + a.auditId)
3132
})
3233

0 commit comments

Comments
 (0)