-
Notifications
You must be signed in to change notification settings - Fork 230
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
fix(coverage): get close to 100% test coverage #67
Conversation
rules/no-disabled-tests.js
Outdated
@@ -1,19 +1,16 @@ | |||
'use strict'; | |||
|
|||
function getName(node) { | |||
function joinNames(a, b) { |
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.
@borilla mind sharing why you added the check? None of the tests hit this path, so I just inlined it
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.
Just defensive coding, but I can come up with a theoretical example using an anonymous object:
({ f: function () {} }).f()
rules/no-disabled-tests.js
Outdated
} | ||
|
||
/* istanbul ignore next */ | ||
return 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.
Is this just to be future proof?
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.
This is for any unmatched node-types (ie those we can't find names for), eg
(a || b).f(); // callee.object here is LogicalExpression
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.
Great, thanks! Added those 2 examples, and coverage hit 100% 🙂
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.
👍
rules/no-focused-tests.js
Outdated
@@ -27,6 +27,7 @@ module.exports = { | |||
create: context => ({ | |||
CallExpression(node) { | |||
const callee = node.callee; | |||
/* istanbul ignore if */ | |||
if (!callee) { |
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.
@jkimbo this is an old one, can you provide details on the cases where a CallExpression
has no callee
?
rules/valid-expect-in-promise.js
Outdated
@@ -17,6 +17,7 @@ const isExpectCallPresentInFunction = body => { | |||
return body.body.find(line => { | |||
if (line.type === 'ExpressionStatement') | |||
return isExpectCall(line.expression); | |||
/* istanbul ignore else */ | |||
if (line.type === 'ReturnStatement') return isExpectCall(line.argument); |
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.
@tushardhole can you provide some sample code where this condition is false
?
@xfumihiro Do you think we could add some tests covering the uncovered parts of |
90a7104
to
d56a0ed
Compare
I'm gonna merge as is, and open up a separate issue for 100% |
It would be great if we could get to 100% coverage, especially as we're so close!
Missing a couple of branches in utils.js, but I've also added a couple of ignores I would like to drop. Help appreciated!
Missing coverage: