Skip to content

Commit daaa539

Browse files
committed
add tests changed report
1 parent a794240 commit daaa539

File tree

17 files changed

+110
-10
lines changed

17 files changed

+110
-10
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
with:
2626
report-path: './ctrf/*.json'
2727
summary-delta-report: true
28+
tests-changed-report: true
2829
github-report: true
2930
failed-report: true
3031
flaky-report: true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ For more advanced usage, there are several inputs available.
121121
# Reports - Choose as many as you like. Default is false. Choosing none will use default reports.
122122
summary-report: true
123123
summary-delta-report: false
124+
tests-changed-report: false
124125
github-report: false
125126
test-report: false
126127
test-list-report: false

__tests__/ctrf/helpers.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ describe('getEmoji', () => {
1313
expect(getEmoji('skipped')).toBe('⏭️')
1414
})
1515

16+
it('returns the correct emoji for "pending"', () => {
17+
expect(getEmoji('pending')).toBe('⏳')
18+
})
19+
20+
it('returns the correct emoji for "other"', () => {
21+
expect(getEmoji('other')).toBe('❓')
22+
})
23+
24+
it('returns the correct emoji for "build"', () => {
25+
expect(getEmoji('build')).toBe('🏗️')
26+
})
27+
1628
it('returns the correct emoji for "duration"', () => {
1729
expect(getEmoji('duration')).toBe('⏱️')
1830
})

__tests__/ctrf/report-preparation.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ function createSingleReportInputs(): Inputs {
491491
collapseLargeReports: false,
492492
summaryReport: true, // Only 1 report enabled
493493
summaryDeltaReport: false,
494+
testsChangedReport: false,
494495
githubReport: false,
495496
testReport: false,
496497
testListReport: false,

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ inputs:
3030
description: 'Include the summary delta report.'
3131
required: false
3232
default: false
33+
tests-changed-report:
34+
description:
35+
'Include the tests changed report showing added and removed tests.'
36+
required: false
37+
default: false
3338
github-report:
3439
description: 'Include the GitHub report.'
3540
required: false

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

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

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/reports/tests-changed-table.hbs

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

src/core/inputs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function getCliInputs(args: Arguments): Inputs {
2020
collapseLargeReports: false,
2121
summaryReport: args._.includes('summary'),
2222
summaryDeltaReport: args._.includes('summary-delta'),
23+
testsChangedReport: args._.includes('tests-changed'),
2324
githubReport: args._.includes('github'),
2425
testReport: args._.includes('tests'),
2526
testListReport: args._.includes('test-list'),
@@ -105,6 +106,8 @@ export function getInputs(): Inputs {
105106
summaryReport: core.getInput('summary-report').toLowerCase() === 'true',
106107
summaryDeltaReport:
107108
core.getInput('summary-delta-report').toLowerCase() === 'true',
109+
testsChangedReport:
110+
core.getInput('tests-changed-report').toLowerCase() === 'true',
108111
testReport: core.getInput('test-report').toLowerCase() === 'true',
109112
testListReport: core.getInput('test-list-report').toLowerCase() === 'true',
110113
failedReport: core.getInput('failed-report').toLowerCase() === 'true',

0 commit comments

Comments
 (0)