-
-
Notifications
You must be signed in to change notification settings - Fork 540
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
feat(lint): rule noMisplacedAssertion
#1935
Conversation
✅ Deploy Preview for biomejs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
CodSpeed Performance ReportMerging #1935 will not alter performanceComparing Summary
|
45047e7
to
106ad4b
Compare
825c038
to
a4801c1
Compare
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 like this rule, but I think it's a bit too opinionated towards the describe
/it
pattern. At the least I would let it support the test
function (and ideally also Deno.test
) by default as well, like these:
And then we can probably add the bun:test
specifier too :)
I refactored the rule. I removed the options - for now. Let's see what the users say and devise a plan when the time comes. Now the built-in assertions are wider, for example bun, |
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.
Very nice!
What about |
And maybe allow to use |
Hey @ipanasenko, thank you for your suggestions. I advise you to create a discussion, a thread on discord or a new issue. Commenting on closed PRs doesn't help the visibility of your suggestions. |
Summary
This PR closes #1848 (last rule)
It implements the rule
noMisplacedAssertion
, which checks ifexpect
orassert
are called inside theit
function.This rule has options: users can define the name of the assertion functions and the specifiers from which these functions are imported.
Test Plan
Added test cases