Open ChrisMBarr opened 2 weeks ago
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#check