Testing React components that are context consumers has typically been messy. The more context providers they need the messier it gets. Read on to explore this pattern which makes it crisp and declarative, and consequently makes TDD with React a bit better 👾
https://overcompiled.dev/post/testing-react-context-using-testing-library/
Do you use a pattern that helps you with this? Let me know!
Top comments (0)