fix: added chain operator to avoid empty reports when an annotation is wrongly set e.g. test.info.annotations.push(' //')

This commit is contained in:
lorenzourb 2024-08-21 10:56:56 +02:00
parent b66cb6caaa
commit e960dcb31a

View file

@ -176,7 +176,7 @@ function cacheSearchValues(test: TestCaseSummary & { [searchValuesSymbol]?: Sear
line: String(test.location.line), line: String(test.location.line),
column: String(test.location.column), column: String(test.location.column),
labels: test.tags.map(tag => tag.toLowerCase()), labels: test.tags.map(tag => tag.toLowerCase()),
annotations: test.annotations.map(a => a.type.toLowerCase() + '=' + a.description?.toLocaleLowerCase()) annotations: test.annotations.map(a => a.type?.toLowerCase() + '=' + a.description?.toLocaleLowerCase())
}; };
test[searchValuesSymbol] = searchValues; test[searchValuesSymbol] = searchValues;
return searchValues; return searchValues;