-
Notifications
You must be signed in to change notification settings - Fork 14
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
test: add type notation in tests #548
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 5641b0e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 9 targets
Sent with 💌 from NxCloud. |
Could that be a linting rule? |
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.
Nice improvmenet!
In general, lots of things could be linting rules. The more practical question is: Are there any linting rules available in the ecosystem? If not, we would have to implement that lint rule ourselves, in which case the cost-benefit ratio becomes highly questionable. The current @code-pushup/eslint-config contains all the available rules I could find which I thought were beneficial. It's possible I missed something, of course. But mostly I would say that if it hasn't been added already, there's good chance it's because it doesn't exist or I didn't think it was beneficial (an inaccurate linting rule is worse than no linting rule, IMO). Also, keep in mind that lint rules should be something that's universally a good thing. When it comes to practices that are good in some cases but in other's it's pointless or even counter-productive, then it's very difficult to automate accurately with a lint rule. Regarding your specific requests:
So in both cases, we would have to implement our own lint rule. I don't think either are important enough to prioritize such work though. |
Upon discovering one can use a type argument in
toEqual
andtoStrictEqual
, I added these arguments in our tests. They replace the need forsatisfies
in expected test output.Note: The type argument cannot be used when the output from
expect
is a promise that requires aresolves
first.