How to make unit testing with Prismic

I am trying to do unit tests with Jest and React Testing Library on a component that uses “PrismicLink” and “PrismicNextImage” but when I render my component with my mock data I get the following error

So I wonder if anyone could send me a guide or something similar to do unit testing cause I don't find how to do it

Hello @fdgbatarse, we don't have guides that use Jest for testing. Can you tell me how this error is connected to Prismic? I'm not able to spot a warning related to the Prismic kit.
Thanks

2 Likes

Thanks for your quick response, I think it's related to "prismicLink" and "PrismicNextImage" because when I remove those components, the test don't fail and I am only rendering the component in the test for the moment.

If there is no documentation with Jest and React Testing Library, do you recommend another way to make unit test with prismic?

1 Like

I see. We don't have any documentation for unit testing. I'll add a note in our backlog for future blog ideas. Thanks

1 Like

Understood, thanks

1 Like