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

Cannot read properties of undefined (reading 'length') #78

Closed moisespio closed 10 months ago

moisespio commented 10 months ago

I have this action setup in a monorepo (Turbo) and the workflow is throwing an error after reading the coverage.txt file.

Screenshot 2023-12-14 at 1 42 59 PM

Output: coverage.txt

MishaKav commented 10 months ago

Thanks for the output, I will take a look soon.

moisespio commented 10 months ago

I was actually missing an important thing in my jest.config file. This error occurs when you don't have the text-summary option. In my case, I only had the text.

coverageReporters: ['json', 'json-summary', 'text', 'text-summary']

Probably a good idea to mention this in the docs?

Thanks for looking into it though!