peeky icon indicating copy to clipboard operation
peeky copied to clipboard

Mock network

Open edimitchel opened this issue 4 years ago β€’ 6 comments

Hi peeky 🐱 !

Is it possible to catch and mock natively mousy http requests for component testing ?

edimitchel avatar Aug 17 '21 13:08 edimitchel

What do you mean by "mousy http requests"?

Akryum avatar Aug 17 '21 18:08 Akryum

It's a joke. 😼🏹🐭 I mean to be able to stub http request. And what could be awesome, to be a proxy for the first time and request the back end server, and save the response. Then, on rerun, what is return is the snapshot of the preceding request, and so, the test is runnable in CICD using real data.

edimitchel avatar Aug 17 '21 21:08 edimitchel

😹

Akryum avatar Aug 17 '21 21:08 Akryum

An inspiration for network mocking : https://github.com/BedrockStreaming/superagent-mock

edimitchel avatar Aug 31 '21 07:08 edimitchel

Also a great solution: https://github.com/nock/nock

edimitchel avatar Oct 22 '21 17:10 edimitchel

Leveraging https://mswjs.io/ might make it easy for node and browser environments.

ericchernuka avatar Dec 09 '21 05:12 ericchernuka