Is there any doc to write test for React component wrapping web components #453
|
Is there any doc to write test for React component wrapping web components |
Answered by
capricorn86
May 30, 2022
Replies: 1 comment
|
Hi @ajasingh! 🙂 I don't know of any guide for this. I worked in a project that was a library of web components and many of the consumers used React. We generated the wrappers for React by using the TS compiler to analyze the web component source code, but I guess it would be possible to just use Regexp for it as well. The unit tests tested the web components directly and we only had a small integration test to verify that the React wrappers worked. Another approach if done manually could be to test web components and React separately as the React component and web component can be considered as separate "units". |
0 replies
Answer selected by
capricorn86
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @ajasingh! 🙂
I don't know of any guide for this.
I worked in a project that was a library of web components and many of the consumers used React. We generated the wrappers for React by using the TS compiler to analyze the web component source code, but I guess it would be possible to just use Regexp for it as well. The unit tests tested the web components directly and we only had a small integration test to verify that the React wrappers worked.
Another approach if done manually could be to test web components and React separately as the React component and web component can be considered as separate "units".