| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Hi @apapirovski. Can you also review this one? Thanks in advance. |
Sorry, something went wrong.
There was a problem hiding this comment.
In general LGTM but it should be extended to assert.ok() as assert() is actually just the alias.
Sorry, something went wrong.
Sorry, something went wrong.
|
ping @shobhitchittora — would you like to follow up on this? There's a bit of feedback here from @BridgeAR. |
Sorry, something went wrong.
|
@apapirovski @BridgeAR extended for assert.ok. Please review. |
Sorry, something went wrong.
There was a problem hiding this comment.
I would not prefer assert.ok over assert. Both should be fine out of my perspective.
Sorry, something went wrong.
There was a problem hiding this comment.
I'm a bit confused here. What did you mean when you said extend for assert.ok()?
Sorry, something went wrong.
There was a problem hiding this comment.
In general assert() should be treated identical to assert.ok(). And I meant the tests should be extended to test for both. Before I commented there were only tests for assert().
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for clarifying this. I'll revert the added invalid test for assert(val).
Sorry, something went wrong.
There was a problem hiding this comment.
Done.
Sorry, something went wrong.
There was a problem hiding this comment.
I could be wrong but I think the idea was that assert(foo != bar) should yield the same as assert.ok(foo != bar). Since the former is an alias for the latter. That is, they should both report an error.
(I realize that might be modifying the current rule and is somewhat outside of the scope of the original work.)
Sorry, something went wrong.
There was a problem hiding this comment.
That would indeed be nice but I guess it is best to keep that for a separate PR and I am actually about to improve the assert message for cases like that in #17581
Sorry, something went wrong.
1. Extends tests 2. Refactors code 3. Adds fixer Refs: nodejs#16636
|
@BridgeAR @apapirovski Updated the PR as per the new implementation by @cjihrig. |
Sorry, something went wrong.
|
Mini-CI (enough for this test): https://ci.nodejs.org/job/node-test-commit-light/149/ |
Sorry, something went wrong.
1. Extends tests 2. Refactors code 3. Adds fixer Refs: nodejs#16636 PR-URL: nodejs#16652 Refs: nodejs#16636 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1. Extends tests 2. Refactors code 3. Adds fixer Refs: nodejs#16636 PR-URL: nodejs#16652 Refs: nodejs#16636 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
| Back | FazBrowse Home | New Git URL |
This adds eslint fixer for auto-fixing the usage of assert operators. Also adding fileoverview for the perfer-assert-methods.js file.
For example the fixer change this assert(obj.value !== 9); to assert.notStrictEqual(obj.value, 9);
Refs: #16636
Checklist
Affected core subsystem(s)
Tools