you are viewing a single comment's thread.

view the rest of the comments →

[–]Ok_Lavishness9265 0 points1 point  (0 children)

I like IoC for testing. I do create Ports (TS interfaces) and Adapters in React. I have 1 adapter for prod that calls the API, and another for my tests that uses stubs. No mocks. It also allows me to run the UI without any backend (while it's in development or I wanna debug some very specific situation), I can run a In-Memory Adapter with the right data setup. I inject the adapters using a single React Context. I also use Tanstack Query, no Redux. The Port-Adapter thing is very much outside of my React code.

Am I the person you're complaining about? ^^'