Contract testing for UI components #1075
Replies: 7 comments
-
I think at an abstract level it makes complete sense. We had a conversation with the authors of Webpack a year or so ago, including how it would work for federated modules (I'd need to dig up the Twitter thread that lead to the chat). I'm not across the detail though, what could we be doing to support this now? |
Beta Was this translation helpful? Give feedback.
-
Thank you @mefellows for getting back to me. It would be great if you could dig down that conversation you had in the past. I think it totally makes sense to not restrict this to APIs and Messages from brokers such as Kafka. Various books mention contract testing for microfrontends but I haven't managed to find a tool yet for it. I think it would be great if we could work out a way with Pact to do this too. |
Beta Was this translation helpful? Give feedback.
-
I went to a talk at my last client, where they got the creator of module federation in to talk about its upsides/downsides, testing approaches, but left before I got to see it implemented. Have you got something in mind @alessioerosferri a diagram perhaps to try and picture what your vision is |
Beta Was this translation helpful? Give feedback.
-
Do we see any interest in implementing this? |
Beta Was this translation helpful? Give feedback.
-
I'm open to suggestions on how we can support it, but we don't have any concrete plans for doing so. I'm keen to hear any ideas though! |
Beta Was this translation helpful? Give feedback.
-
I'm moving this to a discussion, because there is no clear path forward and having it as an issue is not the best use of that feature. Once we have come up with an agreed approach, we can certainly create an issue to track the implementation. |
Beta Was this translation helpful? Give feedback.
-
I think this would be pretty straightforward if you used pact-message as the transport, and the JSON body of an HTTP message as the content. With a bit of sugar, you could even write two contracts at once in the client - one for the http server, and one for the UI tests. @arsereg / @alessioerosferri - how are you doing the UI tests that you would want this to work with? |
Beta Was this translation helpful? Give feedback.
-
Use case
What is the use case that motivates this feature request?
I use pact for contract testing between UI and APIs, Kafka producers and consumers.
I am working with a federated website that is composed of various microfrontends deployed independently using module federation.
I would like to have something like the current pact testing but between UI elements.
Please describe why you would like Pact-js to have this feature.
I think it makes sense now that micro services and micro front ends are so popular, thanks to their independence of deployments, to have contract testing features for ui elements that are consumed from other UIs.
Beta Was this translation helpful? Give feedback.
All reactions