Scenario: I have a gitlab job where I am running my tests using jest, and moving all the coverage-final.json files into another directory.
Now, I am using a second gitlab job which downloads the coverage-xyz.json files (As artifacts), merges them with nyc merge and then then tries to output the report with cobertura/html (npx nyc report -t ..) - which produces NaN coverage. I am suspecting that the culprit is the path change that happens when we switch between gitlab jobs, since if I download the artifacts and run the commands, coverage is still NaN, but on manually correcting the paths to my local setup, the output is correct.
Question: Is it expected that nyc report will fail to give proper cobertura/html output if the paths reported in coverage.json aren't valid? If yes, are there any options to set them to relative and not absolute paths?
Scenario: I have a gitlab job where I am running my tests using jest, and moving all the coverage-final.json files into another directory.
Now, I am using a second gitlab job which downloads the coverage-xyz.json files (As artifacts), merges them with nyc merge and then then tries to output the report with cobertura/html (npx nyc report -t ..) - which produces NaN coverage. I am suspecting that the culprit is the path change that happens when we switch between gitlab jobs, since if I download the artifacts and run the commands, coverage is still NaN, but on manually correcting the paths to my local setup, the output is correct.
Question: Is it expected that nyc report will fail to give proper cobertura/html output if the paths reported in coverage.json aren't valid? If yes, are there any options to set them to relative and not absolute paths?