Issue with Mono-Repo projects using npm workspaces #438
Replies: 2 comments
-
Some additional information that I was able to assess while troubleshooting this issue. It appears the Jest report file is being incorrectly written to a subdirectory of the project instead of the directory where the Jest command was executed. This behavior is exclusive to GitHub and does not occur when running Jest locally or in an "Act" container. For now, I am mitigating the issue by pre-running the jest tests using an absolute path for the output file:
And then supplying the generated file to the ArtiomTr plugin via the 'coverage-file' attribute:
|
Beta Was this translation helpful? Give feedback.
-
I've figured out the problem. A subproject was executing Thanks |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We recently enhanced one of our projects to become a Mono-Repo, declaring our sub-projects as workspaces in our primary package.json and also declaring them under the "projects" section of our main jest.config.js.
Running Jest tests works fine, but using the Artium plugin results in an error stating that the "report.json" file is not found.
Attached is the relevant portion of the logs:
Notice how the logs state that the file is being written.
Test Suites: 105 passed, 105 total
Tests: 5672 passed, 5672 total
Snapshots: 0 total
Time: 61.517 s
Test results written to: report.json
Running tests ended
Begin collecting coverage...
Loading code coverage from file: report.json
Collecting coverage failed
Error: Coverage output file not found. (file "report.json" not found)
Error: Coverage output file not found. (file "report.json" not found)
at x8 (/home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2136:657)
at async _r (/home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2137:158)
at async z0 (/home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2137:633)
at async /home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2146:15750
at async _r (/home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2137:158)
at async jN (/home/runner/work/_actions/ArtiomTr/jest-coverage-report-action/v2/dist/index.js:2146:15686)
Beta Was this translation helpful? Give feedback.
All reactions