summaryrefslogtreecommitdiff
path: root/tests/unit_node
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit_node')
-rw-r--r--tests/unit_node/http_test.ts8
-rw-r--r--tests/unit_node/tls_test.ts12
2 files changed, 5 insertions, 15 deletions
diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts
index 84d6f5727..2b3b8f509 100644
--- a/tests/unit_node/http_test.ts
+++ b/tests/unit_node/http_test.ts
@@ -322,14 +322,10 @@ Deno.test("[node/http] IncomingRequest socket has remoteAddress + remotePort", a
// deno-lint-ignore no-explicit-any
const port = (server.address() as any).port;
const res = await fetch(
- `http://localhost:${port}/`,
+ `http://127.0.0.1:${port}/`,
);
await res.arrayBuffer();
- if (Deno.build.os === "windows") {
- assertEquals(remoteAddress, "127.0.0.1");
- } else {
- assertEquals(remoteAddress, "::1");
- }
+ assertEquals(remoteAddress, "127.0.0.1");
assertEquals(typeof remotePort, "number");
server.close(() => resolve());
});
diff --git a/tests/unit_node/tls_test.ts b/tests/unit_node/tls_test.ts
index 236dab208..43d6205b0 100644
--- a/tests/unit_node/tls_test.ts
+++ b/tests/unit_node/tls_test.ts
@@ -32,15 +32,13 @@ for (
) {
Deno.test(`tls.connect sends correct ALPN: '${alpnServer}' + '${alpnClient}' = '${expected}'`, async () => {
const listener = Deno.listenTls({
- hostname: "localhost",
port: 0,
key,
cert,
alpnProtocols: alpnServer,
});
const outgoing = tls.connect({
- host: "::1",
- servername: "localhost",
+ host: "localhost",
port: listener.addr.port,
ALPNProtocols: alpnClient,
secureContext: {
@@ -63,7 +61,6 @@ Deno.test("tls.connect makes tls connection", async () => {
const ctl = new AbortController();
let port;
const serve = Deno.serve({
- hostname: "localhost",
port: 0,
key,
cert,
@@ -74,8 +71,7 @@ Deno.test("tls.connect makes tls connection", async () => {
await delay(200);
const conn = tls.connect({
- host: "::1",
- servername: "localhost",
+ host: "localhost",
port,
secureContext: {
ca: rootCaCert,
@@ -106,7 +102,6 @@ Deno.test("tls.connect mid-read tcp->tls upgrade", async () => {
const { promise, resolve } = Promise.withResolvers<void>();
const ctl = new AbortController();
const serve = Deno.serve({
- hostname: "localhost",
port: 8443,
key,
cert,
@@ -116,8 +111,7 @@ Deno.test("tls.connect mid-read tcp->tls upgrade", async () => {
await delay(200);
const conn = tls.connect({
- host: "::1",
- servername: "localhost",
+ host: "localhost",
port: 8443,
secureContext: {
ca: rootCaCert,