You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a monorepo with a one NestJS server project using Jest for tests, and the others are front-end Angular apps using Jasmine/Karma for testing. My Jest tests work perfectly, and I am able to execute my Jasmine tests and generate the JUint and coverage JSON files, but I get this error
Please note that I am well aware that this project is specifically about Jest and not Jasmine/Karma, however it seems as though both frameworks can generate the same reporting files, so I'm not sure it matters too much.
Here is my karma.conf.js file for one of the web apps
And then the web apps are set up with this script in package.json "test-coverage-report": "ng test --no-watch --code-coverage --reporters=junit --browsers=ChromeHeadless"
When I run that script locally, it generates a junit.xml file and it generates a coverage-file.json file, which look correct to me
And then on GitHub I run all my tests like this
- name: 🧪 Unit Tests - Serverworking-directory: serverrun: npx jest --coverage --coverageReporters=text --coverageReporters=json-summary --reporters=jest-junit --reporters=github-actions
- name: 🧪 Unit Tests - webapp1working-directory: webapp1run: npm run test-coverage-report
- name: 🧪 Unit Tests - webapp2working-directory: webapp2run: npm run test-coverage-report
- name: 🧪 Unit Test Reporteruses: MishaKav/jest-coverage-comment@mainif: ${{ always() }}with:
title: Code Coverage Reportmultiple-files: | NestJS Server, ./server/coverage/coverage-summary.json Web App One, ./webapp1/coverage/webapp1/coverage-final.json Web App Two, ./webapp2/coverage/webapp2/coverage-final.jsonmultiple-junitxml-files: | NestJS Server, ./server/junit.xml Web App One, ./webapp1/junit.xml Web App Two, ./webapp2/junit.xml
When I run this on github, this is what is produced:
Since the output says it can read the file, but then it cannot read a lines property, my suspicion is that it it trying to read the coverageThreshhold.global.lines property of the jest.config.js file, which does not exist in these web app projects. Is there some way to tell it to read these simple percentage properties from a different file? Here is how karma sets those up: https://github.com/karma-runner/karma-coverage/blob/master/docs/configuration.md#check
The text was updated successfully, but these errors were encountered:
I haven't worked with karma before, so it's hard to say if it should work or no.
Need to look at the files that karma provide and compare their format to the jest format file.
Can you provide some example files that karma generates?
If you can't provide files, which is fine, you can compare the files that you have with the current files format that this action is working:
examples
I have a monorepo with a one NestJS server project using Jest for tests, and the others are front-end Angular apps using Jasmine/Karma for testing. My Jest tests work perfectly, and I am able to execute my Jasmine tests and generate the JUint and coverage JSON files, but I get this error
Please note that I am well aware that this project is specifically about Jest and not Jasmine/Karma, however it seems as though both frameworks can generate the same reporting files, so I'm not sure it matters too much.
Here is my
karma.conf.js
file for one of the web appsAnd then the web apps are set up with this script in
package.json
"test-coverage-report": "ng test --no-watch --code-coverage --reporters=junit --browsers=ChromeHeadless"
When I run that script locally, it generates a
junit.xml
file and it generates acoverage-file.json
file, which look correct to meAnd then on GitHub I run all my tests like this
When I run this on github, this is what is produced:
Since the output says it can read the file, but then it cannot read a
lines
property, my suspicion is that it it trying to read thecoverageThreshhold.global.lines
property of thejest.config.js
file, which does not exist in these web app projects. Is there some way to tell it to read these simple percentage properties from a different file? Here is how karma sets those up: https://github.com/karma-runner/karma-coverage/blob/master/docs/configuration.md#checkThe text was updated successfully, but these errors were encountered: