Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces unit tests powered by Vitest.
A significant part of the effort in this PR was addressing the challenges of testing React server components, as detailed in this issue: React Testing Library Issue #1209. Thanks to the solution provided in the linked comment, I was able to write tests for my asynchronous React components.
Additionally, here is a link to the demo project that helped me resolve these issues: rsc-testing.
Another challenge I encountered was that, for some reason, Vitest was generating empty snapshots. I was able to work around this issue by first accessing the screen. After doing so, the snapshots were generated with the expected content.
You can see in this commit the snapshots were just an empty div
after calling the screen in this commit the snapshots were generated correctly.