-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use subtests for esbuild, mdx, and remark-mdx #2327
Conversation
These packages have significantly sized test cases. Using subtests helps when troubleshooting these tests.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportPatch and project coverage have no change.
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #2327 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 2246 2246
Branches 4 4
=========================================
Hits 2246 2246 ☔ View full report in Codecov by Sentry. |
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.
Looks like a couple cases earlier on have a capitalized, different message, while the assertion message is still in place. I think you can move that message to the test case (so that it prints like “should ...”). Then it’s TLDR but fine!
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.
Thanks @remcohaszing!
It might be even nicer to use describe
and it("should ...")
for suites and tests, but that is nice to have.
This in and of itself is a good improvement. 👍
I’m personally not much of a fan of describe and it. AFAIK they don’t add anything really, and using |
I like using |
They add clarity, by being closer to natural language.
some Again, this is not a blocker. |
Thanks Remco! Appreciate the work! <3 |
I don’t really buy into this argument; it sounds nice, but if that’s the case, why don‘t we do that in other places as much as tests?
It used to be that there was a clearer divide between test as the whole wrapper, and assert for the actual testing things. Remco pointed out that he prefers wrapping assertions into separate test cases so that tests keep running if one assertion fails, and that the output is nicer (you see a bunch of green stuff for what’s good, red stuff for what isn’t). I feel like that’s more another layer of |
That's a good question, why not?
agreed
I agree there is another layer of grouping. |
My personal answer would be: because programming is not natural language. Trying to merge them doesn’t work well. But that’s from my experience.
I used to use it https://github.com/retextjs/retext/blob/1.0.0/test.js, jasmine/mocha, I personally preferred
This is interesting! Why? |
I'm not saying they are precisely the same, nor that we should merge them.
It by naming convention and design convention focuses on, the why and what of how a piece of code should work. |
Important distinction is of course, sure, we use natural language, but trying to make a running English sentence with code is something else. To me, |
These packages have significantly sized test cases. Using subtests helps when troubleshooting these tests.