-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is jest still sufficient to write unit tests for server components ? #19
Comments
That complex object is the implementation details of the server component, which IMO should not be tested in the unit tests. I think We can test the server components just like the normal functional component, we can assert if some child component is getting rendered or not, and with what props the child components are getting rendered. |
Any way to test async components? |
yes |
care to elaborate? |
You can use jest multi projects to have both configs for client and server like this https://github.com/sibelius/next-jest-multiproject/blob/main/jest.config.js server components can run in both |
So i was wondering if we can write unit tests for server side components using just ? since the the return data from server side components when return from server is some complex Object. Maybe we can add few unit tests in this demo project to showcase the uses.
The text was updated successfully, but these errors were encountered: