Generating report error - cannot convert undefined or null to object
See original GitHub issueI am also having issues with the latest v2.0.4
and I have a similar setup where I run jest and collect coverage in separate steps and then use ArtiomTr/jest-coverage-report-action
for the annotations.
- name: Jest coverage report
uses: ArtiomTr/jest-coverage-report-action@v2.0.4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
coverage-file: ./temp-coverage-results/current/jest.results.json
base-coverage-file: ./temp-coverage-results/target/jest.results.json
threshold: 80
skip-step: all
annotations: failed-tests
With v2.0.4
it keeps failing with TypeError: Cannot convert undefined or null to object
and I am not sure how to debug it.
Out of curiosity I tried to use ArtiomTr/jest-coverage-report-action@Debug-action
instead (mentioned in another conversation) and with that particular version it works perfectly every time: branch in not switching, reports are being collected, annotation with coverage diffs is generated, etc…
I did some research but wasn’t able to figure out where the Debug-action
version comes from… is it based on an older version?! @ArtiomTr
_Originally posted by @raspo in https://github.com/ArtiomTr/jest-coverage-report-action/issues/242#issuecomment-1059559731_
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (9 by maintainers)
Top GitHub Comments
This simple script does the job
./scripts/save-coverage-file.js
package.json
Makes sense 👌 Personally, I got confused by the name of the two properties:
base-coverage-file
andcoverage-file
, thinking that just providing the coverage file should be ok. We may wanna rename them to something that conveys the idea that this is the full json test report file (likebase-json-test-report
orbase-json-output-file
) … although it’s probably not a good idea as it will require a breaking change.