node/lib/internal/bootstrap
Victor Chen 2cd3073e0f
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
PR-URL: https://github.com/nodejs/node/pull/52275
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2024-04-12 17:54:42 +00:00
..
switches lib: account for cwd access from snapshot serialization cb 2024-02-29 20:55:00 +00:00
web lib: refactor lazy loading of undici for fetch method 2024-04-12 17:54:42 +00:00
node.js src: add C++ ProcessEmitWarningSync() 2024-03-18 17:57:43 +08:00
realm.js lib: only build the ESM facade for builtins when they are needed 2024-02-21 00:15:44 +01:00
shadow_realm.js module: bootstrap module loaders in shadow realm 2023-11-13 22:09:47 +08:00