istanbul-cobertura-badger
istanbul-cobertura-badger copied to clipboard
Fix for: Cannot read property 'classes' of undefined
This fix allow to handle different xml structures In my case, the cobertura-coverage.xml had a different structure that made the lib crash:
<?xml version="1.0" ?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage lines-valid="33" lines-covered="29" line-rate="0.8787999999999999" branches-valid="10" branches-covered="8" branch-rate="0.8" timestamp="1523546158798" complexity="0" version="0.1">
<sources>
<source>/Users/xxx/xxx/app</source>
</sources>
<packages>
<class name="app.js" filename="dist/app.js" line-rate="0.9" branch-rate="0.8">
...
</class>
</packages>
Using "istanbul": "v1.1.0-alpha.1" "remap-istanbul": "^0.9.5" "mocha": "^3.5.3"
Coverage decreased (-3.6%) to 88.618% when pulling 1d05ef896591ff0e485f406faa2fcf2feb49960e on AlexBeauchemin:master into f0621f0e30a504819a0e25e86586181a2aae4c00 on intuit:master.
Coverage decreased (-0.4%) to 91.87% when pulling e4315ffa2c8ae07838ecab93a2078bdbf0bb47d4 on AlexBeauchemin:master into f0621f0e30a504819a0e25e86586181a2aae4c00 on intuit:master.
Still this issue exists. Waiting for the PR to be merged. Issue regarding generation of different format by Istanbul was logged here: https://github.com/istanbuljs/istanbuljs/issues/66
This is ready to be merged but I think the maintainers are gone 😞