mirror of
https://github.com/dorny/test-reporter.git
synced 2026-02-03 11:45:22 -08:00
Do not print a title if none is specified in the config
This commit is contained in:
committed by
Jozef Izso
parent
0840d7c281
commit
2b2d091d3d
9
dist/index.js
generated
vendored
9
dist/index.js
generated
vendored
@@ -1817,8 +1817,7 @@ const defaultOptions = {
|
||||
baseUrl: '',
|
||||
onlySummary: false,
|
||||
useActionsSummary: true,
|
||||
badgeTitle: 'tests',
|
||||
reportTitle: 'Test Results'
|
||||
badgeTitle: 'tests'
|
||||
};
|
||||
function getReport(results, options = defaultOptions) {
|
||||
core.info('Generating check run summary');
|
||||
@@ -1881,7 +1880,11 @@ function getByteLength(text) {
|
||||
}
|
||||
function renderReport(results, options) {
|
||||
const sections = [];
|
||||
sections.push(`# ${options.reportTitle}`);
|
||||
const { reportTitle } = options;
|
||||
// Suppress the report title for empty string or whitespace
|
||||
if (reportTitle && reportTitle.trim()) {
|
||||
sections.push(`# ${reportTitle}`);
|
||||
}
|
||||
const badge = getReportBadge(results, options);
|
||||
sections.push(badge);
|
||||
const runs = getTestRunsReport(results, options);
|
||||
|
||||
Reference in New Issue
Block a user