pollyjs icon indicating copy to clipboard operation
pollyjs copied to clipboard

feature: undici adapter

Open ceelias opened this issue 2 years ago • 2 comments

Description

Undici is a built from scratch http client that doesn't use Node's standard http lib. It has has shown to be very performant. Has this been looked at and any plans to implement an adapter?

Relevant Links

ceelias avatar Dec 21 '21 17:12 ceelias

We're using Undici in a project I'm working on. We're in need of this in the short term, so I'm thinking of writing this adapter myself. If anyone is already working on it, or took a look at it, please let me know.

I'm planning to use Undici's built-in mocking capabilities. I was planning to use nock, which is also used by the adapter-node-http, but it doesn't support Unidici yet, and it's unsure if it ever will.

LuudJanssen avatar Apr 17 '22 08:04 LuudJanssen

I tried creating the Undici adapter, but the standard mocking tools for Undici don't support asynchronous callbacks. I created an issue, but for now we will be moving away from Undici so we can use Polly.JS with a regular Node HTTP library.

LuudJanssen avatar Apr 19 '22 14:04 LuudJanssen