About testing rendered elements in vitest/jest #1875
-
Hi. In my case, for example, I may want to test that the A endpoint includes an anchor element that goes to the B or C endpoint
I'm not familiar with react, but do you guys also use testing-library when doing unit tests for hono/jsx?
I have a few errors in front of me, but before I resolve them, I would like to hear from you guys in the community. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @PorcoRosso85, When working with "hono/jsx", I recommend referring to https://github.com/honojs/hono/tree/main/src/jsx and following these steps for testing. It's advised not to use "@testing-library/react" in this scenario.
On the other hand, if you're using React instead of hono/jsx, "@testing-library/react" is the preferred option. |
Beta Was this translation helpful? Give feedback.
Hi @PorcoRosso85,
When working with "hono/jsx", I recommend referring to https://github.com/honojs/hono/tree/main/src/jsx and following these steps for testing. It's advised not to use "@testing-library/react" in this scenario.
toString()
to convert to stringOn the other hand, if you're using React instead of hono/jsx, "@testing-library/react" is the preferred option.