-
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?
Conversation
if (err) { | ||
console.log(err); | ||
} | ||
console.log("Deleted the badge file " + coverageBadgePath); |
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.
'console' is not defined.
|
||
fs.unlink(coverageBadgePath, function(err) { | ||
if (err) { | ||
console.log(err); |
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.
'console' is not defined.
expect(err).to.be.null; | ||
expect(badgeStatus).to.be.an("object"); | ||
|
||
console.log(badgeStatus); |
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.
'console' is not defined.
fs.stat(coverageBadgePath, function gettingStats(err, stats) { | ||
expect(err).to.be.null; | ||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
|
||
// 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
console.log(badgeStatus); | ||
|
||
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
'__dirname' is not defined.
@@ -94,6 +94,47 @@ describe("istanbul-cobertura-badger", function() { | |||
}); | |||
}); | |||
|
|||
it("should compute overall coverage over packages without classes and create the badge", function(done) { |
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.
Still this issue exists. Waiting for the PR to be merged. |
This is ready to be merged but I think the maintainers are gone 😞 |
This fix allow to handle different xml structures
In my case, the cobertura-coverage.xml had a different structure that made the lib crash:
Using
"istanbul": "v1.1.0-alpha.1"
"remap-istanbul": "^0.9.5"
"mocha": "^3.5.3"