I have a backend written in node.js that uses external APIs on some endpoints. I want to do load test without testing those external dependencies. Is it possible to mock them and how? I don't really care about the time it takes to reach the APIs and it has to be excluded from the test. The mock should be as easy as returning a plain object. Right now I've been trying to use k6 or artillery to do those tests but I had no luck on finding out how to mock. Any resources that could help me achieve my goal?
Asked
Active
Viewed 842 times
1 Answers
1
Have you tried xk6-mock k6 extension?
Also Wiremock is very powerful and easy to use. It even has REST API so you can create mock mappings from k6 using simple HTTP calls
There are also online mock services like Mockoon or BlazeMeter Mock Services

Dmitri T
- 159,985
- 5
- 83
- 133
-
The problem is that I don't want to mock the entire http endpoint. Only services that are used inside those endpoints and the rest of the logic should stay the same. I tried xk6-mock for example but I can't see the option to mock only one part of the endpoint (call to external API) – fraktus Jan 17 '22 at 14:16