Open Cactusbone opened 2 years ago
Hello! I think the only solution is to write an "hack" with proxyquire.
Thanks for the answer, I've been using http-proxy for mocking only parts of elasticsearch (to simulate errors), with an actual elasticsearch as fallback. It works quite well and does not require mingling with the client lib, just pass the http-proxy url to the client and you're good to go :) (not using elasticsearch-js-mock at all)
Following install multiple versions
I have
in my package.json
However when adding elasticsearch-mock, it uses
require('@elastic/elasticsearch')
for{ Connection, errors }
(without a peer dependency too ...)How can I use the client I want with mock ?