-
-
Notifications
You must be signed in to change notification settings - Fork 30
Update: utils.getTestInfo filter elements equal to null (fixes #37). #38
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
Conversation
lib/utils.js
Outdated
@@ -179,8 +179,8 @@ module.exports = { | |||
const invalidProperty = run.properties.find(prop => module.exports.getKeyName(prop) === 'invalid'); | |||
|
|||
return { | |||
valid: validProperty && validProperty.value.type === 'ArrayExpression' ? validProperty.value.elements : null, | |||
invalid: invalidProperty && invalidProperty.value.type === 'ArrayExpression' ? invalidProperty.value.elements : null, | |||
valid: validProperty && validProperty.value.type === 'ArrayExpression' ? validProperty.value.elements.filter(Boolean) : 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.
I‘m considering changing the null
to []
-- this can also avoid some null check.
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.
Sounds good to me.
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.
Thanks for the PR!
Can you add tests for this here?
Also, I think there are some null checks in rules that can now be removed.
ping @not-an-aardvark |
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.
LGTM, thanks!
No description provided.