Skip to content

Commit d3cd15f

Browse files
committed
Refactor tests-changed report to utilize length helper for improved readability and maintainability
1 parent 0efb464 commit d3cd15f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

dist/reports/tests-changed-table.hbs

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/reports/tests-changed-table.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{{#if (and report.insights.extra.testsAdded report.insights.extra.testsRemoved (or (gt report.insights.extra.testsAdded.length 0) (gt report.insights.extra.testsRemoved.length 0)))}}
2-
**{{report.insights.extra.testsAdded.length}} new test{{#if (gt report.insights.extra.testsAdded.length 1)}}s{{/if}} added, {{report.insights.extra.testsRemoved.length}} removed**
1+
{{#if (and report.insights.extra.testsAdded report.insights.extra.testsRemoved (or (gt (length report.insights.extra.testsAdded) 0) (gt (length report.insights.extra.testsRemoved) 0)))}}
2+
**{{length report.insights.extra.testsAdded}} new test{{#if (gt (length report.insights.extra.testsAdded) 1)}}s{{/if}} added, {{length report.insights.extra.testsRemoved}} removed**
33

4-
{{#if (gt report.insights.extra.testsAdded.length 0)}}
4+
{{#if (gt (length report.insights.extra.testsAdded) 0)}}
55
### Added ➕
66

77
| **Name** | **Suite** |
@@ -11,7 +11,7 @@
1111
{{/each}}
1212
{{/if}}
1313

14-
{{#if (gt report.insights.extra.testsRemoved.length 0)}}
14+
{{#if (gt (length report.insights.extra.testsRemoved) 0)}}
1515
### Removed ➖
1616

1717
| **Name** | **Suite** |

0 commit comments

Comments
 (0)