vercel / next.js

The React Framework
https://nextjs.org
MIT License
122.59k stars 26.23k forks source link

Update unit test docs in compliance with testing-library release #67217

Closed jophy-ye closed 2 days ago

jophy-ye commented 2 days ago

What

Updated slightly out-of-date docs of Vitest & Jest Manual Setup to install required peer dependency to work with React Testing Library v16, which was released 3 weeks ago at the time of writing.

Why

Beginning from React Testing Library v16, @testing-library/dom has become a peer dependency and needs to be explicitly installed alongside @testing-library/react.

How

Install the package in the example command.

ijjk commented 2 days ago

Allow CI Workflow Run

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

jophy-ye commented 2 days ago

Hmm... I wonder why some of the build tests are not successful when I updated several lines of the docs. In fact, it seems the last 10 pull requests with the "Documentation" tag do not pass most tests. Interesting🤔

jophy-ye commented 2 days ago

@devjiwonchoi You have your point. Indeed, this page is more of a tutorial than a formal API reference, intending to help people setup a minimum viable example.

devjiwonchoi commented 2 days ago

Cool! Can you remove it? We can merge afterwards 🙏

jophy-ye commented 2 days ago

I’m extremely sorry if this question seems naive: should I commit the deletion and preserve history, or change the existing commit to make the history merged into next.js cleaner? I couldn’t find a contributing guide on this.

I can do it right away. Thank you so much.

devjiwonchoi commented 2 days ago

No need to apologize, I'm here to help! 😆

You can remove those explanation and push it to the current branch!

We do a squash & merge to keep the main branch history clean, so as to have less consideration on our working branch.