strapi / documentation

Strapi Documentation
https://docs.strapi.io
Other
1.03k stars 1.13k forks source link

[Request]: Unit testing and its setup should be well documented. #2166

Closed fhouser closed 3 months ago

fhouser commented 3 months ago

Summary

The documentation for unit testing is severely neglected. See --> Unit Testing

Jest is not the issue, but rather the setup, configuration, and instantiation of a testable Strapi app.

This documentation is missing and should be prioritized even before Strapi v5 is released.

Why is it needed?

The current unit testing documentation Unit Testing does not lead to a working base configuration. See the linked/related issue for the types of errors experienced.

Suggested solution(s)

No response

Related issue(s)/PR(s)

7811

pwizla commented 3 months ago

Thank you very much for reporting this, @fhouser.

I will close this request as it is a duplicate of other ones referenced in the meta issue #1940.

In the meantime, feel free to read the following blog post about testing with Jest and Supertest: https://strapi.io/blog/automated-testing-for-strapi-api-with-jest-and-supertest. If it's not working with Strapi v4, we'll ask the original author to update it.