-
Notifications
You must be signed in to change notification settings - Fork 518
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
How to test a mitosis component ? #1268
Comments
Right now, the most useful way to test a mitosis component is to:
At Builder, we have a playwright integration tests suite that runs in parallel against multiple servers, each importing a different Mitosis output. |
@samijaber I guess it's not possible to use something like Storybook React as JSX lite won't be supported / cause problems? Currently I am testing it with webapps for React/Vue/Angular as those are the outputs we want to support. Having to set up our own test apps + build/watch scripts for HMR is fine as long as it's to verify the output and testing framework specific implementations. But having it as a debug/test while still developing the mitosis component (
Having something like storybook for mitosis would solve most of these issues and provide a better DX. |
That is technically impossible because Mitosis is not a rendering framework or a runtime. The Mitosis JSX syntax is merely a parser from JSX to JSON. There is no "Mitosis component" to render. The only way to test Mitosis content is to render it using one an actual web framework. You are already doing that.
You can try the I typically add hooks like I will close this issue as there is nothing actionable that can be done about it at this point. |
I am interested in helping provide a feature!
Yes
Which generators are impacted?
What problem does this feature solve?
I would like to develop my components using the TDD approach. It is necessary for me to have a test environement that can interpret a "mitosis component" in order to implement a test first and implement the code at a second time.
What does the proposed API look like?
I like the Stencil approach with their test environment.
Could be great to develop this kind of stuff.
Additional Information
No response
The text was updated successfully, but these errors were encountered: