-
Notifications
You must be signed in to change notification settings - Fork 49
Simplifying tests #111
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
Simplifying tests #111
Conversation
Yes. This is fantastic. |
👌 |
There you go. I think we can improve it a bit further by handling cases like |
return currentTestNode; | ||
}; | ||
|
||
rule.if = rest(function (predicates) { |
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.
[nits] if
is a reserved word for ECMAScript so we better avoid it.
Good alternatives? when
?
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.
That's only needed for ES3 backwards compatibility.
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.
Yep, so it's just a nitpicking.
But it also makes syntax highlighting annoying IMO.
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.
Yeah, colorwise, it gets shown with the same color as an if
in my editor, and I thought that was actually pretty nice, as that highlights pretty well what it does. Happy to change it to when
if you want.
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 prefer if
. We don't care about ES3. If your editor is highlighting it incorrectly, I suggest opening and issue/PR on your editor.
Sublime is very open to pull requests for syntax highlighting now btw: https://github.com/sublimehq/Packages
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.
In Atom for instance, the return
method of Bluebird
return Promise.resolve(foo)
.return(bar);
also gets highlighted like the return
keyword. Which is nice IMO :)
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.
Agreed to go with if
👍
LGTM 👍 |
Fixes #72
WIP, just tackled one of the rules, to see the reactions. Does this still look good to you @sindresorhus @jamestalmage @twada? If so, I'll go and do the others.