MishaKav / jest-coverage-comment

Comments a pull request or commit with the jest code coverage badge, full report and tests summary
MIT License
80 stars 34 forks source link

Is there a way to combine the `coverage.txt` file if I run my tests in multiple parallel containers? #94

Closed aviralpostman closed 2 months ago

aviralpostman commented 2 months ago
image

Currently, the coverage-path parameter accepts only a single file path. What's the way to get the coverage.txt file in case we're running tests in parallel?

MishaKav commented 2 months ago

The proper way to use coverage is to generate a proper report using the coverage-summary-path: ./coverage/coverage-summary.json. In your case, you can also use multiple-files like:

multiple-files: |
      My-Title-1, ./coverage_1/coverage-summary.json
      My-Title-2, ./coverage_2/coverage-summary.json

You can read more in the main readme of the action. P.S. The usage of | tee ./coverage.txt is mainly for very limited and simple use-cases.