documentation
documentation copied to clipboard
[Request]: Unit tests V4 documentation and general complete V4 documentation
Summary
The unit testing documentation isn't up-to-date for v4 and doesn't work, same with many other parts of the documentation that generally feels like minimum effort was put into updating it from v3 to v4
Why is it needed?
More broadly, why was this not done before releasing v4? I get that you were all trying to release v4 as fast as you could, but it feels like you weren't even considering onboarding new developers to Strapi or giving the information needed to existing developers migrating from v3 to v4. When I first encountered the docs in v3, they had their flaws, but were overall okay and made the experience of using Strapi relatively easy. If I'd have encountered the v3 docs in the state the v4 docs are in, I flat out wouldn't have chosen to use Strapi. I really don't get how you could do a major release with so many breaking changes and not release documentation at the same time. It's incredibly frustrating when multiple parts of the documentation aren't up-to-date for really, really basic things like Unit Testing, especially coming up to 9 months since v4 was released. There are 2 or 3 posts about unit testing and one kindly put together template by @qunabu (https://github.com/qunabu/strapi-unit-test-example) that I can't get working. It really shouldn't be on a third party to provide a template for, again, something as basic as unit testing
Suggested solution(s)
Update unit testing and realistically all docs to v4 and don't release major releases without completing all documentation first, otherwise you're just making customers who use your product suffer, get negative opinions about Strapi and decrease the chance they'll continue to use it and recommend it to others
Related issue(s)/PR(s)
https://forum.strapi.io/t/v4-unit-testing/14818
https://stackoverflow.com/questions/70974645/unit-testing-with-jest-for-strapi-v4
https://github.com/qunabu/strapi-unit-test-example
Hello @callum-gander. Thanks for your feedback. I will make sure it is relayed internally. There are a couple of open PRs to improve the unit testing documentation, but I am fairly certain they just fix small parts and don't offer a complete solution. https://github.com/strapi/documentation/pull/1152 https://github.com/strapi/documentation/pull/1151
I will also add this as a topic for an upcoming discussion about the guides section specifically.
Thank you for the quick response. I hope it can get resolved soon. It seems strange that there were small fixes when the code doesn't work for v4. This may be due to the fact that I'm running on a slightly out of a date version, 4.2.2, due to an issue with building the admin panel when I update to the latest versions but I don't think so. I copy and pasted the code exactly as in the commits you just mentioned, and I got the error "create table public
.strapi_migrations
(id
integer not null primary key autoincrement, name
varchar(255), time
datetime) - SQLITE_ERROR: unknown database public
" (`` prevent this being formated properly).
@callum-gander I started reworking the unit testing guide. I am still working through the original guide and testing what does and doesn't work. Any feedback along the way is appreciated. PR #1225
Sure, I'll have a look at it this weekend and give any feedback I can think of that might be helpful. Thanks for letting me know!
Author or original guide here, if you need any help i might be able to spare some time.
btw my code is working with ver 4.3.6 - I have updated my repo few weeks ago.
- https://github.com/qunabu/strapi-unit-test-example
- report https://app.codecov.io/gh/qunabu/strapi-unit-test-example
although this refers to JS version, not TypeScript so far (TBA)
btw my code is working with ver 4.3.6 - I have updated my repo few weeks ago.
- https://github.com/qunabu/strapi-unit-test-example
- report https://app.codecov.io/gh/qunabu/strapi-unit-test-example
although this refers to JS version, not TypeScript so far (TBA)
Thanks @qunabu! Adding TypeScript support is one of the items on my list. Right now, based on the existing documentation I have everything working through the basic endpoint example. Though I still have an open handle. My working repo is here.
I have updated all of the examples for the unit testing documentation. Thanks @qunabu I heavily used (and starred) your repo. I am still making some changes to streamline the examples as much as possible. Any feedback is helpful before I finalize the page.
TypeScript is to come, probably in the new year.
Closing this as I'm sure there are more specific issues than this general issue now