DEV Community

Discussion on: API e2e testing event driven systems

Collapse
 
samnash profile image
sam-nash

This is a great article.
A more specific example using event driven systems like kafka would have been a great guidance.

Cant Cypress stubs or mock feature be used for contract driven testing ?

Collapse
 
muratkeremozcan profile image
Murat K Ozcan • Edited

Once I learn Kafka, I promise it will be there. Alas, the API e2e testing of the system might just be exactly the same.

For API testing , there is no mocking and stubbing. The mirror of your UI based idea is in fact from Pact.io; consumer driven contract testing. You run what looks like a unit test at the API client, it generates a Jason file, and then a broker ensures that the provider is aligned with what the API client expects. This is the key solution to testing service integration prior to a common deployment.

When I learn enough about Pact, I will be sure to write about it. For now, here are some examples github.com/muratkeremozcan/pactio.