Make getNxCoveragePaths more robust
User story
As an Nx user, I want to use the getNxCoveragePaths function to more easily configure @code-pushup/coverage-plugin. However, this function has too many assumptions built-in for it to be useful for a simple Nx + Jest setup.
Acceptance criteria
- [x] do not require
coverageDirectory(Jest) orreportsDirectory(Vitest) option to be set inproject.json, also look for these properties injest.config.tsandvitest.config.tsfiles (customizable viaconfigoption inproject.json) - [ ] Vitest's paths are relative to project root, but Jest's paths are relative to workspace root - the
projectPathproperty should only be set for Vitest, not Jest
Implementation details
No response
Related comment: https://github.com/code-pushup/cli/pull/604#discussion_r1555497103
Vitest's paths are relative to project root, but Jest's paths are relative to workspace root - the projectPath property should only be set for Vitest, not Jest
Additional information: For Cypress + nyc it is also relative to project root, not workspace root. However, Cypress can configure coverage from different sources so relying on report-dir inside .nycrc.json would not be wise.