From 41cd7bb9396f5a32ae09bee8213d2cdd85463659 Mon Sep 17 00:00:00 2001 From: wuls Date: Wed, 24 May 2023 15:47:16 +0800 Subject: [PATCH] test --- packages/astro/test/test-utils.js | 1 + packages/integrations/node/package.json | 3 ++- packages/integrations/node/src/get-network-address.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/astro/test/test-utils.js b/packages/astro/test/test-utils.js index c523ea96f..01391e828 100644 --- a/packages/astro/test/test-utils.js +++ b/packages/astro/test/test-utils.js @@ -190,6 +190,7 @@ export async function loadFixture(inlineConfig) { const previewServer = await preview(mergeConfig(inlineConfig, extraInlineConfig)); config.server.host = parseAddressToHost(previewServer.host); // update host config.server.port = previewServer.port; // update port + console.log(config.server.port, config.server.host, 'test') return previewServer; }, pathExists: (p) => fs.existsSync(new URL(p.replace(/^\//, ''), config.outDir)), diff --git a/packages/integrations/node/package.json b/packages/integrations/node/package.json index 3306b2e57..b80c66108 100644 --- a/packages/integrations/node/package.json +++ b/packages/integrations/node/package.json @@ -30,7 +30,8 @@ "build": "astro-scripts build \"src/**/*.ts\" && tsc", "build:ci": "astro-scripts build \"src/**/*.ts\"", "dev": "astro-scripts dev \"src/**/*.ts\"", - "test": "mocha --exit --timeout 20000 test/" + "test": "mocha --exit --timeout 20000 test/", + "t": "mocha --exit --timeout 20000 test/well-known-locations.test.js" }, "dependencies": { "@astrojs/webapi": "^2.2.0", diff --git a/packages/integrations/node/src/get-network-address.ts b/packages/integrations/node/src/get-network-address.ts index 794ac0c83..3c1a8e691 100644 --- a/packages/integrations/node/src/get-network-address.ts +++ b/packages/integrations/node/src/get-network-address.ts @@ -29,7 +29,7 @@ export function getNetworkAddress(protocol: Protocol = 'http', hostname: string, detail.family === 4), ) .forEach((detail) => { - let host = detail.address.replace('127.0.0.1', hostname === undefined || wildcardHosts.has(hostname) ? '127.0.0.1' : hostname) + let host = detail.address.replace('127.0.0.1', hostname === undefined || wildcardHosts.has(hostname) ? 'localhost' : hostname) // ipv6 host if (host.includes(':')) { host = `[${host}]`