DEV Community

loading...

Discussion on: Rust HTTP Testing with httpmock

Collapse
5422m4n profile image
Sven Assmann • Edited

Great article.
I wonder if there are mock libraries that would record the responses on demand and can turn into a mode that those recorded responses are replayed?

On a different node js project we have used such a thing and it was super handy to not handwrite responses or store them manually and replay them by hand.

PS: connect-prism is the name of the JavaScript lib

Collapse
alexliesenfeld profile image
Alexander Liesenfeld Author • Edited

Thank you. I am not aware of any Rust libraries that do this at the moment but it would be an interesting idea for a new feature in httpmock :-)

Collapse
5422m4n profile image
Sven Assmann

Actually I’m also not aware of any rust lib that can do it. I think it would be a pretty unique feature. It saves so much time and can help to have one test case act as end to end test and turn it into a unit / integration test without the need of changing the test code, if for instance a configuration flag could change the modus.
Do you feel inspired to include it in your httpmock Library? 😁