test
This commit is contained in:
parent
ae8c22cfb2
commit
41cd7bb939
3 changed files with 4 additions and 2 deletions
|
@ -190,6 +190,7 @@ export async function loadFixture(inlineConfig) {
|
||||||
const previewServer = await preview(mergeConfig(inlineConfig, extraInlineConfig));
|
const previewServer = await preview(mergeConfig(inlineConfig, extraInlineConfig));
|
||||||
config.server.host = parseAddressToHost(previewServer.host); // update host
|
config.server.host = parseAddressToHost(previewServer.host); // update host
|
||||||
config.server.port = previewServer.port; // update port
|
config.server.port = previewServer.port; // update port
|
||||||
|
console.log(config.server.port, config.server.host, 'test')
|
||||||
return previewServer;
|
return previewServer;
|
||||||
},
|
},
|
||||||
pathExists: (p) => fs.existsSync(new URL(p.replace(/^\//, ''), config.outDir)),
|
pathExists: (p) => fs.existsSync(new URL(p.replace(/^\//, ''), config.outDir)),
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
||||||
"build:ci": "astro-scripts build \"src/**/*.ts\"",
|
"build:ci": "astro-scripts build \"src/**/*.ts\"",
|
||||||
"dev": "astro-scripts dev \"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": {
|
"dependencies": {
|
||||||
"@astrojs/webapi": "^2.2.0",
|
"@astrojs/webapi": "^2.2.0",
|
||||||
|
|
|
@ -29,7 +29,7 @@ export function getNetworkAddress(protocol: Protocol = 'http', hostname: string,
|
||||||
detail.family === 4),
|
detail.family === 4),
|
||||||
)
|
)
|
||||||
.forEach((detail) => {
|
.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
|
// ipv6 host
|
||||||
if (host.includes(':')) {
|
if (host.includes(':')) {
|
||||||
host = `[${host}]`
|
host = `[${host}]`
|
||||||
|
|
Loading…
Add table
Reference in a new issue