From b2e3389a6aebe5378f49fa86391255f9fc8b0707 Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Fri, 10 Nov 2023 22:43:30 -0600 Subject: fix(node/http): export globalAgent (#21081) Fixes #21080 Fixes #18312 --------- Signed-off-by: Jacob Hummer --- cli/tests/unit_node/http_test.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'cli/tests') diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts index ed52ccf13..84d25e42c 100644 --- a/cli/tests/unit_node/http_test.ts +++ b/cli/tests/unit_node/http_test.ts @@ -812,3 +812,27 @@ Deno.test( await server.finished; }, ); + +Deno.test("[node/http] node:http exports globalAgent", async () => { + const http = await import("node:http"); + assert( + http.globalAgent, + "node:http must export 'globalAgent' on module namespace", + ); + assert( + http.default.globalAgent, + "node:http must export 'globalAgent' on module default export", + ); +}); + +Deno.test("[node/https] node:https exports globalAgent", async () => { + const https = await import("node:https"); + assert( + https.globalAgent, + "node:https must export 'globalAgent' on module namespace", + ); + assert( + https.default.globalAgent, + "node:https must export 'globalAgent' on module default export", + ); +}); -- cgit v1.2.3