-
Notifications
You must be signed in to change notification settings - Fork 34
Fix for: Cannot read property 'classes' of undefined #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" ?> | ||
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd"> | ||
<coverage lines-valid="328" lines-covered="255" line-rate="0.7774" branches-valid="58" branches-covered="30" branch-rate="0.5172" timestamp="1444266082605" complexity="0" version="0.1"> | ||
<sources> | ||
<source>/home/mdesales/dev/github-intuit/servicesplatform-nodejs/sp-quality</source> | ||
</sources> | ||
<packages> | ||
<class name="lint.js" filename="lint.js" line-rate="1" branch-rate="1" > | ||
<methods> | ||
</methods> | ||
<lines> | ||
<line number="5" hits="1" branch="false" /> | ||
<line number="10" hits="1" branch="false" /> | ||
</lines> | ||
</class> | ||
<class name="test.js" filename="test.js" line-rate="0.6" branch-rate="1" > | ||
<methods> | ||
<method name="(anonymous_1)" hits="0" signature="()V" > | ||
<lines><line number="8" hits="0" /></lines> | ||
</method> | ||
<method name="(anonymous_2)" hits="8" signature="()V" > | ||
<lines><line number="15" hits="8" /></lines> | ||
</method> | ||
<method name="(anonymous_3)" hits="0" signature="()V" > | ||
<lines><line number="22" hits="0" /></lines> | ||
</method> | ||
<method name="(anonymous_4)" hits="0" signature="()V" > | ||
<lines><line number="29" hits="0" /></lines> | ||
</method> | ||
<method name="(anonymous_5)" hits="0" signature="()V" > | ||
<lines><line number="37" hits="0" /></lines> | ||
</method> | ||
</methods> | ||
<lines> | ||
<line number="8" hits="1" branch="false" /> | ||
<line number="9" hits="0" branch="false" /> | ||
<line number="15" hits="1" branch="false" /> | ||
<line number="16" hits="8" branch="false" /> | ||
<line number="22" hits="1" branch="false" /> | ||
<line number="23" hits="0" branch="false" /> | ||
<line number="29" hits="1" branch="false" /> | ||
<line number="30" hits="0" branch="false" /> | ||
<line number="37" hits="1" branch="false" /> | ||
<line number="38" hits="0" branch="false" /> | ||
</lines> | ||
</class> | ||
</packages> | ||
</coverage> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,47 @@ describe("istanbul-cobertura-badger", function() { | |
}); | ||
}); | ||
|
||
it("should compute overall coverage over packages without classes and create the badge", function(done) { | ||
// Use the fixture that's without problems | ||
// Using defaults directory /coverage/ | ||
var opts = { | ||
badgeFileName: "coverage-multiple-without-classes", | ||
destinationDir: destinationDir, | ||
istanbulReportFile: path.resolve(__dirname, "fixture", "istanbul-report-multiple-packages-without-classes.xml") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. |
||
}; | ||
|
||
// Load the badge for the report | ||
badger(opts, function parsingResults(err, badgeStatus) { | ||
expect(err).to.be.null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected an assignment or function call and instead saw an expression. |
||
expect(badgeStatus).to.be.an("object"); | ||
|
||
console.log(badgeStatus); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'console' is not defined. |
||
|
||
var fileWithExtension = opts.badgeFileName + ".svg"; | ||
var coverageBadgePath = path.normalize(path.resolve(destinationDir, fileWithExtension)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. |
||
expect(coverageBadgePath.indexOf(fileWithExtension)).to.be.above(0); | ||
|
||
// Verify that the badge file was successfully created | ||
fs.stat(coverageBadgePath, function gettingStats(err, stats) { | ||
expect(err).to.be.null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected an assignment or function call and instead saw an expression. |
||
expect(stats).to.be.an("object"); | ||
expect(stats.isFile()).to.be.true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected an assignment or function call and instead saw an expression. |
||
expect(stats.size).to.be.above(0); | ||
|
||
fs.unlink(coverageBadgePath, function(err) { | ||
if (err) { | ||
console.log(err); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'console' is not defined. |
||
} | ||
console.log("Deleted the badge file " + coverageBadgePath); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'console' is not defined. |
||
|
||
done(); | ||
}); | ||
|
||
}); | ||
|
||
}); | ||
}); | ||
|
||
}); | ||
|
||
describe("Parsing reports with xml problems", function() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.