Replies: 1 comment
-
|
Linking a very helpful discussions I found about this: And there is some movement on this from the Storybook devs, that looks really promising: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I really dig, that browser mode is now stable. I also dig React Server Components.
Thinking about these things, I thought, that for perfectly testing RSC, we'd need something in between Node and browser based tests. A typical RSC fetches data asynchronously and renders based on this data. Data fetching is done on the server (never in the browser), but the rendered component of course still get's displayed in the browser. So in a perfect world, I could test this component by rendering it in node, than render it in a browser env and check the output.
On the other hand: RSC's are unable to define client side interactions, so probably this is a non-issue and we should just unit test RSC components with Node as we always did, but unfortunately we won't be able to do visual regression testing without having a browser involved.
I just wanted to share this thought, and maybe start a discussion on how we should handle RSC unit tests as best practice.
Beta Was this translation helpful? Give feedback.
All reactions