Open patrickReiis opened 3 months ago
Quoting the docs:
Deno will collect test coverage into a directory for your code if you specify the
--coverage
flag when starting deno test.
Does passing the --coverage
flag to enable coverage collection when running the tests work?
It creates a coverage
directory that contains JSON
files, not xml
files.
I need it in xml
files so I can use gitlab's feature, using the junit-path
flag works but doesn't put the coverage inside the xml
file.
I see. Took a deeper look into this and it seems like JUnit doesn't support storing coverage data. I cannot find anything in the specs floating around the internet like https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd . They only deal with basic test reporting.
Looking at the documentation from GitLab it seems like are not expecting JUnit either, but rather a different format called Cobertura XML.
For the coverage analysis to work, you have to provide a properly formatted Cobertura XML report to
artifacts:reports:coverage_report
.
Right now we don't have a coverage reporter in Deno for the Cobertura XML format. Turning this issue into a feature request.
Thank you very much!!
Deno 1.45.2
I have this following script in my
deno.json
file:{"test": "deno test -A --junit-path=./deno-test.xml"}
It creates this
xml
file which is nice, however when I open this file there's no code coverage, it only says the amount of time it took to run, here a random line to use as an example:<testcase name="zap receipt does not have a "description" tag" classname="./src/pipeline.test.ts" time="0.017" line="60" col="6">