-
Notifications
You must be signed in to change notification settings - Fork 22
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
Implement new rule no-assert-ok
#78
Conversation
Thanks for the PR! I'll hopefully have time to review this weekend. |
Thanks! Take your time, I'll be traveling next week so I might have a little less time to implement the feedback, but I'll definitely keep an eye on this :-). |
Hi, just wanted to say I haven't forgotten about this but I've been very busy. Unfortunately, this weekend will be another busy one, but I'm hoping to look at this in the next couple of weeks. |
No problema. Thanks for the update! |
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.
Hi @ventuno, thanks for putting this together and thank you as well for your patience as I was delayed in reviewing this.
I've called out a few minor issues via inline comments.
Here's a few more things:
- Could you please add some tests for the new code in
lib/utils.js
? One option might be to create a fake/test rule that uses the function (maybe with fake assertion names, etc.) and then run RuleTester on that rule to make sure it demonstrates the expected behavior. - Please look at the Travis CI results-- there are some failing tests. Most of these have to do with ensuring the rule is referenced in the README, as well as ensuring the rule is available in the plugin definition file (
index.js
in the project's top-level directory). Can you please fix these?
Thanks again for contributing, I appreciate it!
Thanks for the review @platinumazure! I addressed all comments can you please take another look?
I can definitely do that, but I'm not 100% if such test would be really valuable? After all this is implicitly tested once the code is used by
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.
Thank you for addressing my feedback!
Only one request: Could you please add some correct code examples to the documentation? Probably that just means some uses of the other assertion types that could be used instead.
Otherwise looks great! Thanks again for contributing!
And I'm okay with skipping tests on the utility method at this point. If I change my mind later, I can always figure out the tests myself. |
Thanks @platinumazure, I updated the docs. Please take another look. Also, should we discuss next steps? With reference to the description:
|
@platinumazure any update on this? |
@platinumazure wondering if there's anything left for me to do on this? I addressed your latest request for changes and added some correct code examples to the docs. I'm looking forward to starting on the next steps! |
Sorry, everything is good on your end (I'm pretty sure), I've just been busy. My suggestion is, let's not waste time refactoring the other rule because it would also be made obsolete by Next steps:
What do you think? |
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 looks ready to merge.
Just one thing: You didn't name yourself as @author
in lib/rules/no-assert-ok.js. This isn't required and I would be okay with merging as-is, but you did write an author name in tests/lib/rules/no-assert-ok.js. So it's up to you.
If you want to make that change, feel free to just push an extra commit to this branch. I'll squash the commits during merge. Otherwise, if you're okay with me committing as-is, just let me know and I'll merge.
Thanks for contributing, and thanks also for your extraordinary patience. :-)
Thanks @platinumazure, I just pushed a new change with the Also, thanks again for your support. I'm glad we did this. I think it's a step in better testing for all of us! I'll start working on |
@ventuno Just as a follow-up, I finally regained access to my npm account today. Hoping to publish a minor release with this PR soon (maybe this weekend). |
That's great news. Thanks @platinumazure! |
@platinumazure just enabled this today. Thanks a lot for the release :-). |
@platinumazure here's my attempt at implementing #77.
Apologies for this not being super polished, but I wanted to have something out to make sure we were on the same page.
A few notes:
createAssertionCheck
-- still thinking of a better name) that can look for usages of assertions (global or against the localassert
object);no-assert-equal
could for example be refactored as:no-loose-assertions
could be implemented as:utils
may not be the best place forcreateAssertionCheck
maybe it could live in its own utility file?TODO: