Skip to content

lib: refactor lazy loading of undici for fetch method

Object.defineProperty is updated to lazily load the undici dependency for the fetch method. This change allows for simpler and more reliable mocking of the fetch method for testing purposes, resolving issues encountered with premature method invocation during testing.

Fixes: https://github.com/nodejs/node/issues/52015

Merge request reports

Loading