docs: MockAgent.get() documentation is missing required options for MockPool.intercept()
See original GitHub issueBug Description
Currently, the MockAgent.get()
documentation shows using an implementation of MockPool.intercept()
without the (seemingly, both in my own testing and based on what MockPool.intercept()
docs say) required method
property.
Reproducible By
Trying to run any of the examples in MockAgent.get()
documentation that use a ``MockPool.intercept()implementation without the
method` property.
Expected Behavior
Examples should be functioning properly.
Logs & Screenshots
Environment
N/A
Additional context
Should be fixable by just adding the method
property to every options object where includes
is used.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
MockAgent don't intercept Pool requests · Issue #996 - GitHub
a function that takes a Client/Pool and use it to make that request, let's call it execute(); create a MockClient/MockPool and pass it...
Read more >Mocking With Undici Like a Pro - Fusebit
The basic entrypoint into the mocking system is the MockAgent class, which has a get() method returning a MockClient or MockPool instance, ...
Read more >undici - UNPKG
This method creates and retrieves MockPool or MockClient instances which can then be used to intercept HTTP requests. If the number of connections...
Read more >Node.js Undici
Sets the global dispatcher used by Common API Methods. undici.getGlobalDispatcher(). Gets the global dispatcher used by Common API Methods. Returns: Dispatcher ...
Read more >nock - npm
This setup says that we will intercept every HTTP call to https://api.github.com . It will intercept an HTTPS GET request to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah yes, I’m on 5.8.2. That doesn’t change the need to update docs inconsistency, though 😊
It says in the types that it defaults to get, which makes more sense than throwing an error imo.
https://github.com/nodejs/undici/blob/0862fba5406ff7d45e3b80cd0aaea952098b5a6c/types/mock-interceptor.d.ts#L47