Netflix / pollyjs

Record, Replay, and Stub HTTP Interactions.
https://netflix.github.io/pollyjs
Apache License 2.0
10.21k stars 352 forks source link

feature: undici adapter #443

Open ceelias opened 2 years ago

ceelias commented 2 years ago

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

LuudJanssen commented 2 years ago

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 commented 2 years ago

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.