test: Increase coverage
Description
Goal, increase test coverage.
Area concerned:
- ✅
util/ - ✅
hooks/ - 🆗
next-data/some have been tested, but not all - ✅
providers/
Validation
All test should pass.
Related Issues
No related issue.
Check List
- [X] I have read the Contributing Guidelines and made commit messages that follow the guideline.
- [x] I have run
npx turbo lintto ensure the code follows the style guide. And runnpx turbo lint:fixto fix the style errors if necessary. - [x] I have run
npx turbo formatto ensure the code follows the style guide. - [X] I have run
npx turbo testto check if all tests are passing. - [X] I've covered new added functionality with unit tests if necessary.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| nodejs-org | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 1, 2024 11:24am |
Any updates here?
stuck with next-data which is giving me a hard time
stuck with
next-datawhich is giving me a hard time
Can you share your difficulties?
Can you share your difficulties?
It's junior's problem. But I don't know what to test. And I don't know where the line is between mocking data and using the real thing. Another point is that it's a part of the infra that I despise less, so I have to test and understand the elements to be able to test them.
Also, why are the generators in mjs and not in typescript?
Can you share your difficulties?
It's junior's problem. But I don't know what to test. And I don't know where the line is between mocking data and using the real thing. Another point is that it's a part of the infra that I despise less, so I have to test and understand the elements to be able to test them. Also, why are the
generatorsinmjsand not in typescript?
There was a reasoning behind, and mostly because they are also imported on other non-ts files. So they cannot be TS ;)
You can ignore the the next-data tests for now, there's no much to test there, besides that the data structures match snapshots or desired outcomes.
For the time being, just update the remaining utils, scripts and anything else that can be unit tested :)
Lighthouse Results
| URL | Performance | Accessibility | Best Practices | SEO | Report |
|---|---|---|---|---|---|
| /en | 🟢 97 | 🟢 96 | 🟢 100 | 🟢 91 | 🔗 |
| /en/about | 🟢 100 | 🟢 96 | 🟢 100 | 🟢 91 | 🔗 |
| /en/about/previous-releases | 🟢 99 | 🟢 95 | 🟢 100 | 🟢 92 | 🔗 |
| /en/download | 🟢 100 | 🟢 95 | 🟢 100 | 🟢 91 | 🔗 |
| /en/blog | 🟢 97 | 🟢 96 | 🟢 100 | 🟢 92 | 🔗 |
I fix conflict. And all is good normally (if you don't test next-data).
someone can run the tests on his machine, because on mine it works. Yes, it sounds like a joke, but it's really strange. And yes, I did push my last commit.
someone can run the tests on his machine, because on mine it works. Yes, it sounds like a joke, but it's really strange. And yes, I did push my last commit.
What works on your machine but not here?
What works on your machine but not here?
On the CI jest to tests that fail. But on my Mac I have all the tests that pass.
Unit Test Coverage Report
| Lines | Statements | Branches | Functions |
|---|---|---|---|
| 89.68% (574/640) | 75.1% (175/233) | 91.4% (117/128) |
Unit Test Report
| Tests | Skipped | Failures | Errors | Time |
|---|---|---|---|---|
| 120 | 0 :zzz: | 0 :x: | 0 :fire: | 5.506s :stopwatch: |
Holy moly macaroni, Ci is green again (can't wait to leave jest) @nodejs/nodejs-website you can review now
@AugustinMauroy I guess I messed up on the rebase, can you fix it?
@AugustinMauroy I guess I messed up on the rebase, can you fix it?
always a pleasure to fight with Jest
@AugustinMauroy I guess I messed up on the rebase, can you fix it?
always a pleasure to fight with Jest
It's more like the file was renamed and.. well, I choose the wrong name on the rebase 🤡
(You can address that on a follow-up PR)