Skip to content

Commit 998cd3a

Browse files
committed
Update README; use empty string as default
1 parent e2662c6 commit 998cd3a

4 files changed

Lines changed: 17 additions & 11 deletions

File tree

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ jobs:
154154
# Allows you to generate reports for Actions Summary
155155
# https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/
156156
use-actions-summary: 'true'
157+
158+
# Optionally specify a title (Heading level 1) for the report. Leading and trailing whitespace are ignored.
159+
# This is useful for separating your test report from other sections in the build summary.
160+
# If omitted or set to whitespace/empty, no title will be printed.
161+
report-title: ''
157162
158163
# Customize the title of badges shown for each Actions Summary.
159164
# Useful when distinguish summaries for tests ran in multiple Actions steps.
@@ -345,7 +350,7 @@ Support for Swift test results in xUnit format is experimental - should work but
345350

346351
Unfortunately, there are some known issues and limitations caused by GitHub API:
347352

348-
- Test report (i.e. Check Run summary) is markdown text. No custom styling or HTML is possible.
353+
- Test report (i.e. build summary) is Markdown text. No custom styling or HTML is possible.
349354
- Maximum report size is 65535 bytes. Input parameters `list-suites` and `list-tests` will be automatically adjusted if max size is exceeded.
350355
- Test report can't reference any additional files (e.g. screenshots). You can use `actions/upload-artifact@v4` to upload them and inspect them manually.
351356
- Check Runs are created for specific commit SHA. It's not possible to specify under which workflow test report should belong if more

__tests__/java-junit.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ describe('java-junit tests', () => {
1313
baseUrl: '',
1414
onlySummary: false,
1515
useActionsSummary: true,
16-
badgeTitle: 'tests'
16+
badgeTitle: 'tests',
17+
reportTitle: ''
1718
}
1819

1920
it('produces empty test run result when there are no test cases', async () => {

dist/index.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/report/get-report.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface ReportOptions {
1515
onlySummary: boolean
1616
useActionsSummary: boolean
1717
badgeTitle: string
18-
reportTitle?: string
18+
reportTitle: string
1919
}
2020

2121
const defaultOptions: ReportOptions = {
@@ -24,7 +24,8 @@ const defaultOptions: ReportOptions = {
2424
baseUrl: '',
2525
onlySummary: false,
2626
useActionsSummary: true,
27-
badgeTitle: 'tests'
27+
badgeTitle: 'tests',
28+
reportTitle: ''
2829
}
2930

3031
export function getReport(results: TestRunResult[], options: ReportOptions = defaultOptions): string {
@@ -103,9 +104,8 @@ function getByteLength(text: string): number {
103104
function renderReport(results: TestRunResult[], options: ReportOptions): string[] {
104105
const sections: string[] = []
105106

106-
const {reportTitle} = options
107-
// Suppress the report title for empty string or whitespace
108-
if (reportTitle && reportTitle.trim()) {
107+
const reportTitle: string = options.reportTitle.trim()
108+
if (reportTitle) {
109109
sections.push(`# ${reportTitle}`)
110110
}
111111

0 commit comments

Comments
 (0)