jestjs / jest

Delightful JavaScript Testing.
https://jestjs.io
MIT License
44.12k stars 6.44k forks source link

Jest needs disclaimers. #15135

Closed jedwards1211 closed 1 month ago

jedwards1211 commented 3 months ago

Page(s)

https://jestjs.io/docs

Description

The architecture of Jest has very significant consequences on what is and isn’t possible to do with Jest tests:

But many people don’t realize this and see Jest as a one-size-fits-all testing solution because it’s so popular. It’s not one-size-fits-all, and this is a poorly communicated fact. Jest needs a top-level disclaimer page that explains these limitations in its docs. The disclaimer should include:

You get PRs like https://github.com/jestjs/jest/issues/8708, which seems like something that's clearly contrary to Jest's philosophy, because people started using Jest before realizing how hard it would be to fulfill their needs with it.

There are projects for which Jest’s opinions about strong isolation are beneficial and projects where it isn’t. Most other testing frameworks I’m familiar with provide less test isolation, so they don’t have the limitations I mentioned above, and therefore may be more suitable for some projects.

I had one such project where it was impossible to achieve good performance testing ts-morph transforms with Jest, but my boss at the time was not very open to alternatives that would have saved us time and effort. I tried to persuade him it was by design but he failed to see that strong isolation is central to Jest’s design and not something the maintainers intend to change.

If only I had an official disclaimer from the project itself, I would have been more able to convince him what was in our best interest, and he might not have had such a dogmatic attitude about it to begin with.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

github-actions[bot] commented 1 week ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.