I've used this tool in a React project in which Jest is being used for code coverage reporting. There are, sadly, two problems with the main branch. Thus, introduced some improvements. Problems:
A)file entry in clover.xml contains name and path attributes. name is just the file name with extension. While path contains the full file system path. Example:
Both these issues have been fixed in this PR. Reproduced and tested in the following changsets, which are identical when it comes to modified spec files. The difference is in workflows; negligible change.
I've used this tool in a React project in which Jest is being used for code coverage reporting. There are, sadly, two problems with the
main
branch. Thus, introduced some improvements. Problems:A)
file
entry inclover.xml
containsname
andpath
attributes.name
is just the file name with extension. Whilepath
contains the full file system path. Example:B) The
xml2json
package is not returning a list of files, when only a single spec is within given directory. Namely, not this:but this:
seem to be the right type.
Both these issues have been fixed in this PR. Reproduced and tested in the following changsets, which are identical when it comes to modified
spec
files. The difference is in workflows; negligible change.Broken:
https://github.com/jacekk/comment-coverage-clover--jest-support/pull/1
Fixed:
https://github.com/jacekk/comment-coverage-clover--jest-support/pull/2
In summary:
Additionally,
filters === []
seems to be alwaysfalse
- JS is reference-based for objects and arrays.