Skip to content

Commit ecae468

Browse files
authored
Merge pull request #361 from dkhunt27/hideFlags
Hide flags
2 parents 1f4aec1 + cfcca97 commit ecae468

File tree

21 files changed

+28610
-6629
lines changed

21 files changed

+28610
-6629
lines changed

.github/samples/main-push.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
if-no-files-found: error
5656

5757
- name: Create Code Coverage Badge
58-
uses: dkhunt27/nx-code-coverage@v1
58+
uses: dkhunt27/nx-code-coverage@v2
5959
with:
6060
github-token: ${{ secrets.GITHUB_TOKEN }}
6161
no-coverage-ran: false
@@ -66,3 +66,5 @@ jobs:
6666
gist-id: SOME_GIST_ID
6767
color: green
6868
named-logo: jest
69+
hide-coverage-reports: false
70+
hide-unchanged: false

.github/samples/pull-request.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
continue-on-error: true
6363

6464
- name: Comment Code Coverage on PR
65-
uses: dkhunt27/nx-code-coverage@v1
65+
uses: dkhunt27/nx-code-coverage@v2
6666
with:
6767
github-token: ${{ secrets.GITHUB_TOKEN }}
6868
no-coverage-ran: false
@@ -73,4 +73,6 @@ jobs:
7373
gist-id: SOME_GIST_ID
7474
color: green
7575
named-logo: jest
76+
hide-coverage-reports: false
77+
hide-unchanged: false
7678

.npmcheckrc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
2-
"depcheck":
3-
{
4-
"ignoreMatches":
5-
[
2+
"depcheck": {
3+
"ignoreMatches": [
64
"@types/*",
7-
"npm-check-pr397",
5+
"@jest/globals",
86
"yorkie"
97
]
108
}

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ The report is based on the coverage report generated by your test runner.
7070
cache-seconds:
7171
description: 'The cache lifetime in seconds (must be greater than 300)'
7272
required: false
73+
hide-coverage-reports:
74+
description: true/false to hide the coverage reports
75+
type: boolean
76+
required: true
77+
hide-unchanged:
78+
description: true/false to hide the coverage results that have no diffs
79+
type: boolean
80+
required: true
7381
```
7482
7583
## Setup
@@ -79,7 +87,7 @@ The report is based on the coverage report generated by your test runner.
7987
8088
```yaml
8189
- name: Comment Code Coverage on PR
82-
uses: dkhunt27/nx-code-coverage@v1
90+
uses: dkhunt27/nx-code-coverage@v2
8391
with:
8492
github-token: ${{ secrets.GITHUB_TOKEN }}
8593
no-coverage-ran: false
@@ -90,6 +98,8 @@ The report is based on the coverage report generated by your test runner.
9098
gist-id: d7e6b443a01eba615fd2a7c1215aec91
9199
color: green
92100
named-logo: jest
101+
hide-coverage-reports: false
102+
hide-unchanged: false
93103
```
94104
95105
- See sample workflows
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`comment tests buildComment when hiding coverage reports when hiding unchanged when all results in one then return as expected 1`] = `"Code Coverage:<p></p><table><tbody><tr><th>app diff -</th><th>50.00%</th><th>❌ ▾ -25.00%</th></tr></tbody></table> <br/><table><tbody><tr><th>app diff +</th><th>50.00%</th><th>✅ ▴ +25.00%</th></tr></tbody></table> <br/><table><tbody><tr><th>app diff null</th><th>unknown%</th></tr></tbody></table> <br/>"`;
4+
5+
exports[`comment tests buildComment when hiding coverage reports when hiding unchanged when result coverage is undefined then unknown diff in code coverage comment 1`] = `"Code Coverage:<p></p><table><tbody><tr><th>app A</th><th>unknown%</th></tr></tbody></table> <br/>"`;
6+
7+
exports[`comment tests buildComment when hiding coverage reports when hiding unchanged when result diff is 0 then no code coverage comment 1`] = `"Code Coverage:<p></p>"`;
8+
9+
exports[`comment tests buildComment when hiding coverage reports when hiding unchanged when result diff is negative then negative diff in code coverage comment 1`] = `"Code Coverage:<p></p><table><tbody><tr><th>app A</th><th>50.00%</th><th>❌ ▾ -25.00%</th></tr></tbody></table> <br/>"`;
10+
11+
exports[`comment tests buildComment when hiding coverage reports when hiding unchanged when result diff is positive then positive diff in code coverage comment 1`] = `"Code Coverage:<p></p><table><tbody><tr><th>app A</th><th>50.00%</th><th>✅ ▴ +25.00%</th></tr></tbody></table> <br/>"`;
12+
13+
exports[`comment tests buildComment when hiding coverage reports when not hiding unchanged when all results in one then return as expected 1`] = `"Code Coverage:<p></p><table><tbody><tr><th>app diff 0</th><th>50.00%</th><th>✅ 0.00%</th></tr></tbody></table> <br/><table><tbody><tr><th>app diff -</th><th>50.00%</th><th>❌ ▾ -25.00%</th></tr></tbody></table> <br/><table><tbody><tr><th>app diff +</th><th>50.00%</th><th>✅ ▴ +25.00%</th></tr></tbody></table> <br/><table><tbody><tr><th>app diff null</th><th>unknown%</th></tr></tbody></table> <br/>"`;
14+
15+
exports[`comment tests buildComment when hiding coverage reports when not hiding unchanged when result coverage is undefined then unknown diff in code coverage comment 1`] = `"Code Coverage:<p></p><table><tbody><tr><th>app A</th><th>unknown%</th></tr></tbody></table> <br/>"`;
16+
17+
exports[`comment tests buildComment when hiding coverage reports when not hiding unchanged when result diff is 0 then 0 diff in code coverage comment 1`] = `"Code Coverage:<p></p><table><tbody><tr><th>app A</th><th>50.00%</th><th>✅ 0.00%</th></tr></tbody></table> <br/>"`;
18+
19+
exports[`comment tests buildComment when hiding coverage reports when not hiding unchanged when result diff is negative then negative diff in code coverage comment 1`] = `"Code Coverage:<p></p><table><tbody><tr><th>app A</th><th>50.00%</th><th>❌ ▾ -25.00%</th></tr></tbody></table> <br/>"`;
20+
21+
exports[`comment tests buildComment when hiding coverage reports when not hiding unchanged when result diff is positive then positive diff in code coverage comment 1`] = `"Code Coverage:<p></p><table><tbody><tr><th>app A</th><th>50.00%</th><th>✅ ▴ +25.00%</th></tr></tbody></table> <br/>"`;
22+
23+
exports[`comment tests buildComment when not hiding coverage reports when all results in one then return as expected 1`] = `
24+
"Code Coverage:<p></p><table><tbody><tr><th>app diff 0</th><th>50.00%</th><th>✅ 0.00%</th></tr></tbody></table>
25+
26+
<details><summary>Coverage Report</summary><table><tbody><tr><th>File </th><th> % Stmts </th><th> % Branch </th><th> % Funcs </th><th> % Lines </th><th> Uncovered Line #s </th></tr><tr><td>All&nbsp;files </td><td>&nbsp; 96.42 </td><td>&nbsp; 60 </td><td>&nbsp; 96.66 </td><td>&nbsp; 96.59 </td><td>&nbsp; </td></tr></tbody></table></details> <br/><table><tbody><tr><th>app diff -</th><th>50.00%</th><th>❌ ▾ -25.00%</th></tr></tbody></table>
27+
28+
<details><summary>Coverage Report</summary><table><tbody><tr><th>File </th><th> % Stmts </th><th> % Branch </th><th> % Funcs </th><th> % Lines </th><th> Uncovered Line #s </th></tr><tr><td>All&nbsp;files </td><td>&nbsp; 96.42 </td><td>&nbsp; 60 </td><td>&nbsp; 96.66 </td><td>&nbsp; 96.59 </td><td>&nbsp; </td></tr></tbody></table></details> <br/><table><tbody><tr><th>app diff +</th><th>50.00%</th><th>✅ ▴ +25.00%</th></tr></tbody></table>
29+
30+
<details><summary>Coverage Report</summary><table><tbody><tr><th>File </th><th> % Stmts </th><th> % Branch </th><th> % Funcs </th><th> % Lines </th><th> Uncovered Line #s </th></tr><tr><td>All&nbsp;files </td><td>&nbsp; 96.42 </td><td>&nbsp; 60 </td><td>&nbsp; 96.66 </td><td>&nbsp; 96.59 </td><td>&nbsp; </td></tr></tbody></table></details> <br/><table><tbody><tr><th>app diff null</th><th>unknown%</th></tr></tbody></table>
31+
32+
<details><summary>Coverage Report</summary><table><tbody><tr><th>File </th><th> % Stmts </th><th> % Branch </th><th> % Funcs </th><th> % Lines </th><th> Uncovered Line #s </th></tr><tr><td>All&nbsp;files </td><td>&nbsp; 96.42 </td><td>&nbsp; 60 </td><td>&nbsp; 96.66 </td><td>&nbsp; 96.59 </td><td>&nbsp; </td></tr></tbody></table></details> <br/>"
33+
`;

0 commit comments

Comments
 (0)