diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2023-07-21 02:18:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-21 02:18:07 +0200 |
commit | da709729e3dd6f310182581ca1c6380ad51443fc (patch) | |
tree | e4b49ed701938a9abd98631ffeb9b9a2fced0257 /cli/tests/unit_node | |
parent | 5ff040bf59b1665f0545f9b6e732b027ab676446 (diff) |
fix(node/http): add encrypted field to FakeSocket (#19886)
Fixes #19557
Diffstat (limited to 'cli/tests/unit_node')
-rw-r--r-- | cli/tests/unit_node/http_test.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts index adeaf466d..62cfe59a8 100644 --- a/cli/tests/unit_node/http_test.ts +++ b/cli/tests/unit_node/http_test.ts @@ -637,7 +637,9 @@ Deno.test("[node/http] HTTPS server", async () => { const server = https.createServer({ cert: Deno.readTextFileSync("cli/tests/testdata/tls/localhost.crt"), key: Deno.readTextFileSync("cli/tests/testdata/tls/localhost.key"), - }, (_req, res) => { + }, (req, res) => { + // @ts-ignore: It exists on TLSSocket + assert(req.socket.encrypted); res.end("success!"); }); server.listen(() => { @@ -664,7 +666,9 @@ Deno.test( { permissions: { net: true } }, async () => { const promise = deferred(); - const server = http.createServer((_req, res) => { + const server = http.createServer((req, res) => { + // @ts-ignore: It exists on TLSSocket + assert(!req.socket.encrypted); res.writeHead(200, { "Content-Type": "text/plain" }); res.end("okay"); }); |