-
Notifications
You must be signed in to change notification settings - Fork 727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undici mocks are not picked up by elasticsearch-client #1674
Comments
Confirmed, currently working on a fix. |
I've opened elastic/elastic-transport-js#48 which will solve your issue. Meanwhile, I recommend you checkout |
Hello! With nodejs/undici#1405 your issue should be solved! :) |
@delvedor the test case above still doesn't work on 8.2.1 |
🐛 Bug Report
When using undici's MockAgent to mock requests, the elastic client does not pick up any of the mocks specified. I understand I could also use elasticsearch-mock, and for the most part I do, but in my tests that validate initializing the client is working, I want to test against actual HTTP requests. So this is a desirable feature to suppport
To Reproduce
Jest test which demonstrates the issue:
Expected behavior
elasticsearch-client should respect the Agent set by
setGlobalDispatcher
, but it does not.Your Environment
@elastic/elasticsearch
version: >=8.0.0The text was updated successfully, but these errors were encountered: